Skip to content

Commit b229c11

Browse files
Matvey Kovalevgregkh
authored andcommitted
ksmbd: fix error code overwriting in smb2_get_info_filesystem()
commit 88daf2f upstream. If client doesn't negotiate with SMB3.1.1 POSIX Extensions, then proper error code won't be returned due to overwriting. Return error immediately. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: e2f3448 ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org Signed-off-by: Matvey Kovalev <matvey.kovalev@ispras.ru> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6bd7e0e commit b229c11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5628,7 +5628,8 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
56285628

56295629
if (!work->tcon->posix_extensions) {
56305630
pr_err("client doesn't negotiate with SMB3.1.1 POSIX Extensions\n");
5631-
rc = -EOPNOTSUPP;
5631+
path_put(&path);
5632+
return -EOPNOTSUPP;
56325633
} else {
56335634
info = (struct filesystem_posix_info *)(rsp->Buffer);
56345635
info->OptimalTransferSize = cpu_to_le32(stfs.f_bsize);

0 commit comments

Comments
 (0)