Skip to content

Commit

Permalink
ksmbd: fix malformed unsupported smb1 negotiate response
Browse files Browse the repository at this point in the history
When mounting with vers=1.0, ksmbd should return unsupported smb1
negotiate response. But this response is malformed.

[ 6010.586702] CIFS: VFS: Bad protocol string signature header 0x25000000
[ 6010.586708] 00000000: 25000000 25000000 424d53ff 00000072  ...%...%.SMBr...
[ 6010.586711] 00000010: c8408000 00000000 00000000 00000000  ..@.............
[ 6010.586713] 00000020: 00 00 b9 32 00 00 01 00 01                       ...2.....

Need to consider rfc1001 length when making pinning iov.

Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
namjaejeon committed Nov 5, 2024
1 parent 531daa5 commit 420e694
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion smb_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ static int smb_handle_negotiate(struct ksmbd_work *work)

ksmbd_debug(SMB, "Unsupported SMB1 protocol\n");

if (ksmbd_iov_pin_rsp(work, (void *)neg_rsp,
if (ksmbd_iov_pin_rsp(work, (void *)neg_rsp + 4,
sizeof(struct smb_negotiate_unsupported_rsp) - 4))
return -ENOMEM;

Expand Down

0 comments on commit 420e694

Please sign in to comment.