Commit beff0bc
ksmbd: fix overflow in dacloffset bounds check
The dacloffset field was originally typed as int and used in an
unchecked addition, which could overflow and bypass the existing
bounds check in both smb_check_perm_dacl() and smb_inherit_dacl().
This could result in out-of-bounds memory access and a kernel crash
when dereferencing the DACL pointer.
This patch converts dacloffset to unsigned int and uses
check_add_overflow() to validate access to the DACL.
Cc: [email protected]
Signed-off-by: Norbert Szetei <[email protected]>
Acked-by: Namjae Jeon <[email protected]>
Signed-off-by: Steve French <[email protected]>1 parent fa4cdb8 commit beff0bc
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
1029 | | - | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1030 | 1032 | | |
1031 | 1033 | | |
1032 | 1034 | | |
| |||
1035 | 1037 | | |
1036 | 1038 | | |
1037 | 1039 | | |
| 1040 | + | |
1038 | 1041 | | |
1039 | | - | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1040 | 1045 | | |
1041 | 1046 | | |
1042 | 1047 | | |
| |||
1240 | 1245 | | |
1241 | 1246 | | |
1242 | 1247 | | |
1243 | | - | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
1244 | 1251 | | |
1245 | 1252 | | |
1246 | 1253 | | |
| |||
1259 | 1266 | | |
1260 | 1267 | | |
1261 | 1268 | | |
1262 | | - | |
| 1269 | + | |
| 1270 | + | |
1263 | 1271 | | |
1264 | 1272 | | |
1265 | 1273 | | |
| |||
0 commit comments