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:07:11 +0000 (17:07 +0000)
commit8387c94d73ec66eb597c7a23a8d9eadf64bfbafa
treea2ead533f3914b64a94260f7c57c7691f3170c38
parent482aaa72f95032b0c2ff40cd37a9f3623e185fad
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