]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix overflow in dacloffset bounds check
authorNorbert Szetei <norbert@doyensec.com>
Sat, 29 Mar 2025 06:58:15 +0000 (06:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:38 +0000 (14:39 +0200)
commit6a9cd9ff0fa2bcc30b2bfb8bdb161eb20e44b9dc
tree302b7709d4002cc97c2191f3ecd1ac28a8f13dc7
parent9069939d762138e232a6f79e3e1462682ed6a17d
ksmbd: fix overflow in dacloffset bounds check

commit beff0bc9d69bc8e733f9bca28e2d3df5b3e10e42 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/server/smbacl.c