Skip to contentSkip to conversation

cifs: fix a possible use of uninit variable in SMB2_sess_setup

PATCH Applied Namjae Jeon 2 participants 2 messages Aug 20, 2014 – Aug 21, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/7 cifs: fix a possible use of uninit variable in SMB2_sess_setup

In case of error, goto ssetup_exit can be hit and we could end up using uninitialized value of resp_buftype

---
 fs/cifs/smb2pdu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/cifs/smb2pdu.c +1 -1
index a40f492..ab366e5 100644
@@ -531,7 +531,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
 	struct smb2_sess_setup_rsp *rsp = NULL;
 	struct kvec iov[2];
 	int rc = 0;
-	int resp_buftype;
+	int resp_buftype = CIFS_NO_BUFFER;
 	__le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */
 	struct TCP_Server_Info *server = ses->server;
 	u16 blob_length = 0;
Signature · 1 line
1.7.7
Applied
#1 lore raw

merged into cifs-2.6.git for-next

Quoted 25 lines · Namjae Jeon

In case of error, goto ssetup_exit can be hit and we could end up using uninitialized value of resp_buftype

---
 fs/cifs/smb2pdu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/cifs/smb2pdu.c +1 -2
index a40f492..ab366e5 100644
@@ -531,7 +531,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
        struct smb2_sess_setup_rsp *rsp = NULL;
        struct kvec iov[2];
        int rc = 0;
-       int resp_buftype;
+       int resp_buftype = CIFS_NO_BUFFER;
        __le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */
        struct TCP_Server_Info *server = ses->server;
        u16 blob_length = 0;
--

1.7.7

Signature · 3 lines
Thanks,

Steve