CVE-2026-99309: ksmbd: fix overflow in dacloffset bounds check in build_sec_desc()
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix overflow in dacloffset bounds check in buildsecdesc()
When the large dacloffset is provided, dacloffset + sizeof(struct smbacl) overflows on 32-bit builds and the check is passed, Which makes le16tocpu(ppdaclptr->size) read out-of-bounds. This only happens for dacloffset in range [0xFFFFFFF8, 0xFFFFFFFF]. So the oob read is max 8 bytes preceding the allocated ppntsd.
unsigned int dacloffset = le32tocpu(ppntsd->dacloffset); int ppdaclsize, ntaclsize = ppntsdsize - dacloffset;
if (!dacloffset || (dacloffset + sizeof(struct smbacl) > ppntsdsize)) goto out;
Commit beff0bc9d69b ("ksmbd: fix overflow in dacloffset bounds check") fixes similar checks in other functions. But leaves this one out, because it is only valid for 32-bit builds.
Reproduced on 32-bit ARM with KASAN, by a client sending SMB2 SETINFO(SEC) with dacloffset=0xfffffff8, then QUERYINFO(SEC) on the same file:
BUG: KASAN: slab-out-of-bounds in buildsecdesc (fs/smb/server/smbacl.c:1105) Read of size 2 at addr c2a273fa by task kworker/1:1/35 CPU: 1 UID: 0 PID: 35 Comm: kworker/1:1 Not tainted 7.3.0-rc2+ #5 Workqueue: ksmbd-io handleksmbdwork Call trace: kasancheckrange from buildsecdesc (fs/smb/server/smbacl.c:1105) buildsecdesc from smb2queryinfo (fs/smb/server/smb2pdu.c:7676) smb2queryinfo from handleksmbdwork (fs/smb/server/server.c:160) handleksmbdwork from processonework (kernel/workqueue.c:3401) processonework from workerthread (kernel/workqueue.c:3473) workerthread from kthread (kernel/kthread.c:436)
Add overflow check.