summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorShyam Prasad N <sprasad@microsoft.com>2020-10-15 10:41:31 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 09:54:59 +0100
commita4f751c41a8b67770667451167bdc2ac61e077ac (patch)
tree756fa38ec2bf97ea6ef25590d0c7f6e1e416b000 /fs/cifs
parentab57a8aa9d6ccbee6c8b8bcc4e32a5772272cbcf (diff)
downloadlinux-stable-a4f751c41a8b67770667451167bdc2ac61e077ac.tar.gz
linux-stable-a4f751c41a8b67770667451167bdc2ac61e077ac.tar.bz2
linux-stable-a4f751c41a8b67770667451167bdc2ac61e077ac.zip
cifs: Return the error from crypt_message when enc/dec key not found.
commit 0bd294b55a5de442370c29fa53bab17aef3ff318 upstream. In crypt_message, when smb2_get_enc_key returns error, we need to return the error back to the caller. If not, we end up processing the message further, causing a kernel oops due to unwarranted access of memory. Call Trace: smb3_receive_transform+0x120/0x870 [cifs] cifs_demultiplex_thread+0xb53/0xc20 [cifs] ? cifs_handle_standard+0x190/0x190 [cifs] kthread+0x116/0x130 ? kthread_park+0x80/0x80 ret_from_fork+0x1f/0x30 Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> CC: Stable <stable@vger.kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/smb2ops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 3d63c76ed098..e20d170d13f6 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -2730,7 +2730,7 @@ crypt_message(struct TCP_Server_Info *server, int num_rqst,
if (rc) {
cifs_dbg(VFS, "%s: Could not get %scryption key\n", __func__,
enc ? "en" : "de");
- return 0;
+ return rc;
}
rc = smb3_crypto_aead_allocate(server);