Skip to content

Commit 5a20b7c

Browse files
dhowellsSteve French
authored andcommitted
cifs: Fix signature miscalculation
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: 39bc582 ("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>
1 parent da3ea35 commit 5a20b7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/cifsencrypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static ssize_t cifs_shash_xarray(const struct iov_iter *iter, ssize_t maxsize,
129129
for (j = foffset / PAGE_SIZE; j < npages; j++) {
130130
len = min_t(size_t, maxsize, PAGE_SIZE - offset);
131131
p = kmap_local_page(folio_page(folio, j));
132-
ret = crypto_shash_update(shash, p, len);
132+
ret = crypto_shash_update(shash, p + offset, len);
133133
kunmap_local(p);
134134
if (ret < 0)
135135
return ret;

0 commit comments

Comments
 (0)