Commit 4d80cbe
ksmbd: fix overflow in dacloffset bounds check
stable inclusion
from stable-v6.15-rc1
commit beff0bc
category: bugfix
CVE: CVE-2025-22039
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=beff0bc9d69bc8e733f9bca28e2d3df5b3e10e42
--------------------------------
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: stable@vger.kernel.org
Signed-off-by: Norbert Szetei <norbert@doyensec.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
(cherry picked from commit beff0bc)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Conflicts:
fs/smb/server/smbacl.c1 parent 20d3ae7 commit 4d80cbe
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1031 | 1031 | | |
1032 | 1032 | | |
1033 | 1033 | | |
1034 | | - | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1035 | 1037 | | |
1036 | 1038 | | |
1037 | 1039 | | |
1038 | 1040 | | |
1039 | 1041 | | |
1040 | 1042 | | |
1041 | 1043 | | |
| 1044 | + | |
1042 | 1045 | | |
1043 | | - | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1044 | 1049 | | |
1045 | 1050 | | |
1046 | 1051 | | |
| |||
1243 | 1248 | | |
1244 | 1249 | | |
1245 | 1250 | | |
1246 | | - | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
1247 | 1254 | | |
1248 | 1255 | | |
1249 | 1256 | | |
| |||
1262 | 1269 | | |
1263 | 1270 | | |
1264 | 1271 | | |
1265 | | - | |
| 1272 | + | |
| 1273 | + | |
1266 | 1274 | | |
1267 | 1275 | | |
1268 | 1276 | | |
| |||
0 commit comments