ksmbd: fix slab out of bounds write in smb_inherit_dacl()
authorNamjae Jeon <linkinjeon@kernel.org>
Sun, 5 Nov 2023 03:46:24 +0000 (12:46 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:20:01 +0000 (17:20 +0000)
commit712e01f32e577e7e48ab0adb5fe550646a3d93cb
tree2674c1d6ac50527cc98b9746983cc9751abf969e
parentf4f863a0e901131aff9b7be77590b637acc6f8b1
ksmbd: fix slab out of bounds write in smb_inherit_dacl()

commit eebff19acaa35820cb09ce2ccb3d21bee2156ffb upstream.

slab out-of-bounds write is caused by that offsets is bigger than pntsd
allocation size. This patch add the check to validate 3 offsets using
allocation size.

Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-22271
Cc: stable@vger.kernel.org
Signed-off-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