ksmbd: fix SMB 3.11 posix extension mount failure
authorNamjae Jeon <linkinjeon@kernel.org>
Sat, 22 Jan 2022 01:47:22 +0000 (10:47 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Feb 2022 08:10:26 +0000 (09:10 +0100)
commitab32ea3ad0d5086bad89f7c04cc655b6a4078b04
tree433f82a57a9b5b53bca318d75f2c857f85bdd75c
parent14f880ea779e11a6c162f122c1199e3578e6e3f3
ksmbd: fix SMB 3.11 posix extension mount failure

commit 9ca8581e79e51c57e60b3b8e3b89d816448f49fe upstream.

cifs client set 4 to DataLength of create_posix context, which mean
Mode variable of create_posix context is only available. So buffer
validation of ksmbd should check only the size of Mode except for
the size of Reserved variable.

Fixes: 8f77150c15f8 ("ksmbd: add buffer validation for SMB2_CREATE_CONTEXT")
Cc: stable@vger.kernel.org # v5.15+
Reported-by: Steve French <smfrench@gmail.com>
Tested-by: Steve French <stfrench@microsoft.com>
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/ksmbd/smb2pdu.c