Skip to content

Commit

Permalink
CIFS: Pass page offset for calculating signature
Browse files Browse the repository at this point in the history
When calculating signature for the packet, it needs to read into the
correct page offset for the data.

Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Long Li authored and Steve French committed Jun 5, 2018
1 parent 7cf20bc commit 4c0d2a5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fs/cifs/cifsencrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ int __cifs_calc_signature(struct smb_rqst *rqst,

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

if (i == rqst->rq_npages - 1)
len = rqst->rq_tailsz;
rqst_page_get_length(rqst, i, &len, &offset);

kaddr = (char *) kmap(rqst->rq_pages[i]) + offset;

crypto_shash_update(shash, kaddr, len);

Expand Down

0 comments on commit 4c0d2a5

Please sign in to comment.