mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 17:35:20 +02:00
cifs: Fix signature miscalculation
[ Upstream commit5a20b7cb0d
] Fix the calculation of packet signatures by adding the offset into a page in the read or write data payload when hashing the pages from it. Fixes:39bc58203f
("cifs: Add a function to Hash the contents of an iterator") Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Tom Talpey <tom@talpey.com> Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> cc: Shyam Prasad N <nspmangalore@gmail.com> cc: Rohith Surabattula <rohiths.msft@gmail.com> cc: Jeff Layton <jlayton@kernel.org> cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
6ec7cbc7f5
commit
b9d510e085
|
@ -129,7 +129,7 @@ static ssize_t cifs_shash_xarray(const struct iov_iter *iter, ssize_t maxsize,
|
|||
for (j = foffset / PAGE_SIZE; j < npages; j++) {
|
||||
len = min_t(size_t, maxsize, PAGE_SIZE - offset);
|
||||
p = kmap_local_page(folio_page(folio, j));
|
||||
ret = crypto_shash_update(shash, p, len);
|
||||
ret = crypto_shash_update(shash, p + offset, len);
|
||||
kunmap_local(p);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue
Block a user