summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorPaulo Alcantara <paulo@paulo.ac>2018-06-23 14:52:25 -0300
committerSteve French <stfrench@microsoft.com>2018-08-07 14:15:41 -0500
commita12d0c590cc7ae01892f06c5ad6d19580ecdd0de (patch)
treeb0467b1ea540b6b9748b3e9bf22d5035808fe83b /fs/cifs
parent256b4c3f03d77d8c0dc69e3a6ceb3afd0d1810bd (diff)
downloadlinux-a12d0c590cc7ae01892f06c5ad6d19580ecdd0de.tar.bz2
cifs: Make sure all data pages are signed correctly
Check if every data page is signed correctly in sigining helper. Signed-off-by: Paulo Alcantara <palcantara@suse.de> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsencrypt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index b4672eafc5bf..85b31cfa2f3c 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -83,7 +83,13 @@ int __cifs_calc_signature(struct smb_rqst *rqst,
kaddr = (char *) kmap(rqst->rq_pages[i]) + offset;
- crypto_shash_update(shash, kaddr, len);
+ rc = crypto_shash_update(shash, kaddr, len);
+ if (rc) {
+ cifs_dbg(VFS, "%s: Could not update with payload\n",
+ __func__);
+ kunmap(rqst->rq_pages[i]);
+ return rc;
+ }
kunmap(rqst->rq_pages[i]);
}