aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi/Makefile.objs
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-10-23 00:43:51 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-11-06 21:35:06 +0100
commit3d4a8bf0eed68a781e06118e4d1df6e2f106a1f2 (patch)
tree5c3862b3d67a85b00d86085ee1e9deef9fac1313 /hw/scsi/Makefile.objs
parent57dbb58d800f62b9e56d946660dba4e8dbd20204 (diff)
scsi-generic: avoid invalid access to struct when emulating block limits
Emulation of the block limits VPD page called back into scsi-disk.c, which however expected the request to be for a SCSIDiskState and accessed a scsi-generic device outside the bounds of its struct (namely to retrieve s->max_unmap_size and s->max_io_size). To avoid this, move the emulation code to a separate function that takes a new SCSIBlockLimits struct and marshals it into the VPD response format. Reported-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/Makefile.objs')
-rw-r--r--hw/scsi/Makefile.objs2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/Makefile.objs b/hw/scsi/Makefile.objs
index 718b4c2a68..45167baeaf 100644
--- a/hw/scsi/Makefile.objs
+++ b/hw/scsi/Makefile.objs
@@ -1,4 +1,4 @@
-common-obj-y += scsi-disk.o
+common-obj-y += scsi-disk.o emulation.o
common-obj-y += scsi-generic.o scsi-bus.o
common-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o
common-obj-$(CONFIG_MPTSAS_SCSI_PCI) += mptsas.o mptconfig.o mptendian.o