Commit 9ca8581e authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French
Browse files

ksmbd: fix SMB 3.11 posix extension mount failure



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: 8f77150c ("ksmbd: add buffer validation for SMB2_CREATE_CONTEXT")
Cc: stable@vger.kernel.org # v5.15+
Reported-by: default avatarSteve French <smfrench@gmail.com>
Tested-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent e783362e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2688,7 +2688,7 @@ int smb2_open(struct ksmbd_work *work)
					(struct create_posix *)context;
				if (le16_to_cpu(context->DataOffset) +
				    le32_to_cpu(context->DataLength) <
				    sizeof(struct create_posix)) {
				    sizeof(struct create_posix) - 4) {
					rc = -EINVAL;
					goto err_out1;
				}