qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iscsi: Don't access non-existent scsi_lba_status_descriptor
@ 2020-01-23 17:05 Kevin Wolf
  2020-01-23 20:36 ` Felipe Franciosi
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kevin Wolf @ 2020-01-23 17:05 UTC (permalink / raw)
  To: qemu-block
  Cc: kwolf, pl, qemu-devel, mreitz, ronniesahlberg, felipe, pbonzini

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



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-01-24 13:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-23 17:05 [PATCH] iscsi: Don't access non-existent scsi_lba_status_descriptor Kevin Wolf
2020-01-23 20:36 ` 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é

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).