cifs: Make sure all data pages are signed correctly
authorPaulo Alcantara <paulo@paulo.ac>
Sat, 23 Jun 2018 17:52:25 +0000 (14:52 -0300)
committerSteve French <stfrench@microsoft.com>
Tue, 7 Aug 2018 19:15:41 +0000 (14:15 -0500)
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>
fs/cifs/cifsencrypt.c

index b4672ea..85b31cf 100644 (file)
@@ -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]);
        }