[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221004062333.416225-2-usama.anjum@collabora.com>
Date: Tue, 4 Oct 2022 11:23:33 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Steve French <sfrench@...ba.org>, Paulo Alcantara <pc@....nz>,
Ronnie Sahlberg <lsahlber@...hat.com>,
Shyam Prasad N <sprasad@...rosoft.com>,
Tom Talpey <tom@...pey.com>
Cc: Muhammad Usama Anjum <usama.anjum@...labora.com>,
kernel@...labora.com, kernel-janitors@...r.kernel.org,
linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] cifs: check returned value for error
smb311_decode_neg_context() can return error. Its return value should be
checked for errors.
Signed-off-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
---
fs/cifs/smb2pdu.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 2bf43c892ae6..c6e37352dbe1 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1089,11 +1089,14 @@ SMB2_negotiate(const unsigned int xid,
server->signing_algorithm = SIGNING_ALG_AES_CMAC;
server->signing_negotiated = false;
- if (rsp->NegotiateContextCount)
+ if (rsp->NegotiateContextCount) {
rc = smb311_decode_neg_context(rsp, server,
rsp_iov.iov_len);
- else
+ if (rc)
+ goto neg_exit;
+ } else {
cifs_server_dbg(VFS, "Missing expected negotiate contexts\n");
+ }
/*
* Some servers will not send a SMB2_SIGNING_CAPABILITIES context response (*),
--
2.30.2
Powered by blists - more mailing lists