From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, pl@kamp.de, qemu-devel@nongnu.org,
mreitz@redhat.com, ronniesahlberg@gmail.com, felipe@nutanix.com,
pbonzini@redhat.com
Subject: [PATCH] iscsi: Don't access non-existent scsi_lba_status_descriptor
Date: Thu, 23 Jan 2020 18:05:44 +0100 [thread overview]
Message-ID: <20200123170544.30117-1-kwolf@redhat.com> (raw)
In iscsi_co_block_status(), we may have received num_descriptors == 0
from the iscsi server. Therefore, we can't unconditionally access
lbas->descriptors[0]. Add the missing check.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/iscsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index cbd57294ab..c8feaa2f0e 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -753,7 +753,7 @@ retry:
}
lbas = scsi_datain_unmarshall(iTask.task);
- if (lbas == NULL) {
+ if (lbas == NULL || lbas->num_descriptors == 0) {
ret = -EIO;
goto out_unlock;
}
--
2.20.1
next reply other threads:[~2020-01-23 19:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-23 17:05 Kevin Wolf [this message]
2020-01-23 20:36 ` [PATCH] iscsi: Don't access non-existent scsi_lba_status_descriptor Felipe Franciosi
2020-01-23 20:37 ` John Snow
2020-01-23 21:07 ` Felipe Franciosi
2020-01-23 22:48 ` Peter Lieven
2020-01-24 13:45 ` Kevin Wolf
2020-01-23 21:19 ` Philippe Mathieu-Daudé
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=20200123170544.30117-1-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=felipe@nutanix.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=ronniesahlberg@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).