Commit c6530c1
committed
smb: client: validate dacloffset before building DACL pointers
jira VULN-188328
cve CVE-2026-46195
commit-author Michael Bommarito <michael.bommarito@gmail.com>
commit f98b481
upstream-diff Used linux-5.15.y backport
5de2665e913a10ad70aaeecf736b97276e83d995 for the clean pick
parse_sec_desc(), build_sec_desc(), and the chown path in
id_mode_to_cifs_acl() all add the server-supplied dacloffset to pntsd
before proving a DACL header fits inside the returned security
descriptor.
On 32-bit builds a malicious server can return dacloffset near
U32_MAX, wrap the derived DACL pointer below end_of_acl, and then slip
past the later pointer-based bounds checks. build_sec_desc() and
id_mode_to_cifs_acl() can then dereference DACL fields from the wrapped
pointer in the chmod/chown rewrite paths.
Validate dacloffset numerically before building any DACL pointer and
reuse the same helper at the three DACL entry points.
Fixes: bc3e9dd ("cifs: Change SIDs in ACEs while transferring file ownership.")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
(cherry picked from commit 5de2665e913a10ad70aaeecf736b97276e83d995)
Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>1 parent 1131d20 commit c6530c1
1 file changed
Lines changed: 32 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1254 | 1254 | | |
1255 | 1255 | | |
1256 | 1256 | | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
1257 | 1268 | | |
1258 | 1269 | | |
1259 | 1270 | | |
| |||
1274 | 1285 | | |
1275 | 1286 | | |
1276 | 1287 | | |
1277 | | - | |
1278 | 1288 | | |
1279 | 1289 | | |
1280 | 1290 | | |
| |||
1305 | 1315 | | |
1306 | 1316 | | |
1307 | 1317 | | |
1308 | | - | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
1309 | 1325 | | |
1310 | 1326 | | |
1311 | | - | |
| 1327 | + | |
1312 | 1328 | | |
| 1329 | + | |
1313 | 1330 | | |
1314 | 1331 | | |
1315 | 1332 | | |
| |||
1332 | 1349 | | |
1333 | 1350 | | |
1334 | 1351 | | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1335 | 1357 | | |
1336 | 1358 | | |
1337 | 1359 | | |
| |||
1696 | 1718 | | |
1697 | 1719 | | |
1698 | 1720 | | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
1699 | 1727 | | |
1700 | 1728 | | |
1701 | 1729 | | |
| |||
1738 | 1766 | | |
1739 | 1767 | | |
1740 | 1768 | | |
| 1769 | + | |
1741 | 1770 | | |
1742 | 1771 | | |
1743 | 1772 | | |
| |||
0 commit comments