diff options
author | Long Li <longli@microsoft.com> | 2018-05-30 12:48:03 -0700 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2018-06-05 17:44:30 -0500 |
commit | 4c0d2a5a64332c324d731963861d4a8bb71b7697 (patch) | |
tree | 38b062d0beb92905e744b970c25cedb27b4cb5ba /fs/cifs/cifsencrypt.c | |
parent | 7cf20bce77581bb72af72835e73c9a47d4346b70 (diff) |
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 <longli@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifsencrypt.c')
-rw-r--r-- | fs/cifs/cifsencrypt.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index d3e14d1fc0b5..937251cc61c0 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -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); |