Skip to content

Commit 88daf2f

Browse files
Matvey Kovalevsmfrench
authored andcommitted
ksmbd: fix error code overwriting in smb2_get_info_filesystem()
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: [email protected] Signed-off-by: Matvey Kovalev <[email protected]> Acked-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent c20988c commit 88daf2f

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
@@ -5629,7 +5629,8 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
56295629

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

0 commit comments

Comments
 (0)