cifs: check if SMB2 PDU size has been padded and suppress the warning
authorRonnie Sahlberg <lsahlber@redhat.com>
Wed, 22 Aug 2018 02:19:24 +0000 (12:19 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:42:56 +0000 (09:42 +0200)
commitf440ea422c263d788001dfa9a2890909fe60b63d
treef0ecea6fbf6da3f6e7616c3ccc4cb486eb704ae7
parent947c262a14951b9c99abe72499fda2331f542f2b
cifs: check if SMB2 PDU size has been padded and suppress the warning

[ Upstream commit e6c47dd0da1e3a484e778046fc10da0b20606a86 ]

Some SMB2/3 servers, Win2016 but possibly others too, adds padding
not only between PDUs in a compound but also to the final PDU.
This padding extends the PDU to a multiple of 8 bytes.

Check if the unexpected length looks like this might be the case
and avoid triggering the log messages for :

  "SMB2 server sent bad RFC1001 len %d not %d\n"

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2misc.c