* [PATCH] smb2: fix uninitialized variable bug in smb2_ioctl_query_info
@ 2018-10-09 20:07 Gustavo A. R. Silva
2018-10-09 20:11 ` Gustavo A. R. Silva
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2018-10-09 20:07 UTC (permalink / raw)
To: Steve French, Ronnie Sahlberg
Cc: linux-cifs, samba-technical, linux-kernel, Gustavo A. R. Silva
There is a potential execution path in which variable *resp_buftype*
is passed as an argument to function free_rsp_buf(), in which is used
without being properly initialized previously.
Fix this by initializing variable *resp_buftype* to -1 in order to
avoid unpredictable or unintended results.
Addresses-Coverity-ID: 1472116 ("Uninitialized scalar variable")
Fixes: 1473971 ("Uninitialized scalar variable")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
fs/cifs/smb2ops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index c6c6450d..927aadd 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -1133,7 +1133,7 @@ smb2_ioctl_query_info(const unsigned int xid,
struct smb_rqst rqst;
struct kvec iov[1];
struct kvec rsp_iov;
- int resp_buftype;
+ int resp_buftype = -1;
struct smb2_query_info_rsp *rsp = NULL;
void *buffer;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] smb2: fix uninitialized variable bug in smb2_ioctl_query_info
2018-10-09 20:07 [PATCH] smb2: fix uninitialized variable bug in smb2_ioctl_query_info Gustavo A. R. Silva
@ 2018-10-09 20:11 ` Gustavo A. R. Silva
0 siblings, 0 replies; 2+ messages in thread
From: Gustavo A. R. Silva @ 2018-10-09 20:11 UTC (permalink / raw)
To: Steve French, Ronnie Sahlberg; +Cc: linux-cifs, samba-technical, linux-kernel
On 10/9/18 10:07 PM, Gustavo A. R. Silva wrote:
> There is a potential execution path in which variable *resp_buftype*
> is passed as an argument to function free_rsp_buf(), in which is used
> without being properly initialized previously.
>
> Fix this by initializing variable *resp_buftype* to -1 in order to
> avoid unpredictable or unintended results.
>
> Addresses-Coverity-ID: 1472116 ("Uninitialized scalar variable")
> Fixes: 1473971 ("Uninitialized scalar variable")
ugh... sorry, the line above is wrong... I'll send v2 shotly.
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-09 20:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-09 20:07 [PATCH] smb2: fix uninitialized variable bug in smb2_ioctl_query_info Gustavo A. R. Silva
2018-10-09 20:11 ` Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).