Skip to content

Commit 4c0d2a5

Browse files
longlimsftSteve French
authored andcommitted
CIFS: Pass page offset for calculating signature
When calculating signature for the packet, it needs to read into the correct page offset for the data. Signed-off-by: Long Li <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 7cf20bc commit 4c0d2a5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/cifs/cifsencrypt.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ int __cifs_calc_signature(struct smb_rqst *rqst,
6666

6767
/* now hash over the rq_pages array */
6868
for (i = 0; i < rqst->rq_npages; i++) {
69-
void *kaddr = kmap(rqst->rq_pages[i]);
70-
size_t len = rqst->rq_pagesz;
69+
void *kaddr;
70+
unsigned int len, offset;
7171

72-
if (i == rqst->rq_npages - 1)
73-
len = rqst->rq_tailsz;
72+
rqst_page_get_length(rqst, i, &len, &offset);
73+
74+
kaddr = (char *) kmap(rqst->rq_pages[i]) + offset;
7475

7576
crypto_shash_update(shash, kaddr, len);
7677

0 commit comments

Comments
 (0)