From: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: linux-cifs <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 02/12] cifs: initialize rsp_iov in SMB2_ioctl and check for NULL before deref
Date: Wed, 11 Oct 2017 12:59:17 +1100 [thread overview]
Message-ID: <20171011015927.7669-3-lsahlber@redhat.com> (raw)
In-Reply-To: <20171011015927.7669-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
fs/cifs/smb2pdu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 08701b6125b9..bf35755501e3 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1884,7 +1884,7 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
struct smb2_sync_hdr *shdr;
struct cifs_ses *ses;
struct kvec iov[2];
- struct kvec rsp_iov;
+ struct kvec rsp_iov = { NULL, 0 };
int resp_buftype;
int n_iov;
int rc = 0;
@@ -1981,6 +1981,8 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
rc = SendReceive2(xid, ses, iov, n_iov, &resp_buftype, flags, &rsp_iov);
cifs_small_buf_release(req);
rsp = (struct smb2_ioctl_rsp *)rsp_iov.iov_base;
+ if (rsp == NULL)
+ goto ioctl_exit;
if ((rc != 0) && (rc != -EINVAL)) {
cifs_stats_fail_inc(tcon, SMB2_IOCTL_HE);
--
2.13.3
next prev parent reply other threads:[~2017-10-11 1:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 1:59 [PATCH 00/12] cifs: various fixes for NULL pointers Ronnie Sahlberg
[not found] ` <20171011015927.7669-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-11 1:59 ` [PATCH 01/12] cifs: initialize rsp_iov in SMB2_negotiate Ronnie Sahlberg
2017-10-11 1:59 ` Ronnie Sahlberg [this message]
2017-10-11 1:59 ` [PATCH 03/12] cifs: initialize rsp_iov in SMB2_close Ronnie Sahlberg
2017-10-11 1:59 ` [PATCH 04/12] cifs: initialize rsp_iov in SMB2_query_info Ronnie Sahlberg
2017-10-11 1:59 ` [PATCH 05/12] cifs: initialize rsp_iov in SMB2_flush Ronnie Sahlberg
2017-10-11 1:59 ` [PATCH 06/12] cifs: initialize rsp_iov in SMB2_read and add check for NULL Ronnie Sahlberg
2017-10-11 1:59 ` [PATCH 07/12] cifs: initialize rsp_iov in SMB2_write Ronnie Sahlberg
2017-10-11 1:59 ` [PATCH 08/12] cifs: initialize rsp_iov in SMB2_query_directory Ronnie Sahlberg
2017-10-11 1:59 ` [PATCH 09/12] cifs: initialize rsp_iov in send_set_info Ronnie Sahlberg
2017-10-11 1:59 ` [PATCH 10/12] cifs: initialize rsp_iov in SMB2_QFS_info Ronnie Sahlberg
2017-10-11 1:59 ` [PATCH 11/12] cifs: initialize rsp_iov in SMB2_QFS_attr Ronnie Sahlberg
2017-10-11 1:59 ` [PATCH 12/12] cifs: initialize rsp_iov in smb2_lockv and fix a memory leak Ronnie Sahlberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171011015927.7669-3-lsahlber@redhat.com \
--to=lsahlber-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox