• Ronnie Sahlberg's avatar
    ksmbd: remove RFC1002 check in smb2 request · 18d46769
    Ronnie Sahlberg authored
    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: default avatarHyunchul Lee <hyc.lee@gmail.com>
    Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
    Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    18d46769
smb_common.c 14.8 KB