]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: do not include page data when checking signature
authorEnzo Matsumiya <ematsumiya@suse.de>
Wed, 18 Jan 2023 17:06:57 +0000 (14:06 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:18:00 +0000 (07:18 +0100)
commit4b9e87ca84fc0a2ac9d306b9cfd3dfd72e5ab875
treed0aa475745c949a90e566b5b5daca669046a70f5
parentaf38e03ee70f52b07b0d665868cc856017d44486
cifs: do not include page data when checking signature

commit 30b2b2196d6e4cc24cbec633535a2404f258ce69 upstream.

On async reads, page data is allocated before sending.  When the
response is received but it has no data to fill (e.g.
STATUS_END_OF_FILE), __calc_signature() will still include the pages in
its computation, leading to an invalid signature check.

This patch fixes this by not setting the async read smb_rqst page data
(zeroed by default) if its got_bytes is 0.

This can be reproduced/verified with xfstests generic/465.

Cc: <stable@vger.kernel.org>
Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2pdu.c