]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: Fix validation of signed data in smb3+
authorPaulo Alcantara <paulo@paulo.ac>
Sat, 23 Jun 2018 17:52:23 +0000 (14:52 -0300)
committerSteve French <stfrench@microsoft.com>
Thu, 5 Jul 2018 18:48:24 +0000 (13:48 -0500)
commit1ee6509246d12784de0ed09a5c9df55b7f9b4f49
tree1a520e0ee9a1a4cb5e49c06f3c3c825b0bc3b83d
parent0f0e689f397e543370dc5e63c414bec656f1dc40
cifs: Fix validation of signed data in smb3+

Fixes: 8478f31ebeb2 ("cifs: push rfc1002 generation down the stack")
We failed to validate signed data returned by the server because
__cifs_calc_signature() now expects to sign the actual data in iov but
we were also passing down the rfc1002 length.

Fix smb3_calc_signature() to calculate signature of rfc1002 length prior
to passing only the actual data iov[1-N] to __cifs_calc_signature(). In
addition, there are a few cases where no rfc1002 length is passed so we
make sure there's one (iov_len == 4).

Signed-off-by: Paulo Alcantara <palcantara@suse.de>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2transport.c