]> git.baikalelectronics.ru Git - kernel.git/commit
ksmbd: remove RFC1002 check in smb2 request
authorRonnie Sahlberg <lsahlber@redhat.com>
Tue, 21 Sep 2021 05:45:27 +0000 (14:45 +0900)
committerSteve French <stfrench@microsoft.com>
Sun, 26 Sep 2021 21:47:14 +0000 (16:47 -0500)
commitaacbf9dea981a5c682a129157d1e04b6c03032eb
tree5312e174fb01a40b94810930f661cdb4a1508854
parent875d56e13eab01967bd5d33adc78a50a61ab7b99
ksmbd: remove RFC1002 check in smb2 request

In smb_common.c you have this function :   ksmbd_smb_request() which
is called from connection.c once you have read the initial 4 bytes for
the next length+smb2 blob.

It checks the first byte of this 4 byte preamble for valid values,
i.e. a NETBIOSoverTCP SESSION_MESSAGE or a SESSION_KEEP_ALIVE.

We don't need to check this for ksmbd since it only implements SMB2
over TCP port 445.
The netbios stuff was only used in very old servers when SMB ran over
TCP port 139.
Now that we run over TCP port 445, this is actually not a NB header anymore
and you can just treat it as a 4 byte length field that must be less
than 16Mbyte. and remove the references to the RFC1002 constants that no
longer applies.

Cc: Tom Talpey <tom@talpey.com>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Ralph Böhme <slow@samba.org>
Cc: Steve French <smfrench@gmail.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Acked-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smb_common.c
fs/ksmbd/smb_common.h