qemu-irix/hw/block
Matthew Daley 99b5b999a4 xen_disk: mark ioreq as mapped before unmapping in error case
Commit 4472beae modified the semantics of ioreq_{un,}map so that they are
idempotent if called when they're not needed (ie., twice in a row). However,
it neglected to handle the case where batch mapping is not being used (the
default), and one of the grants fails to map. In this case, ioreq_unmap will
be called to unwind and unmap any mappings already performed, but ioreq_unmap
simply returns due to the aforementioned change (the ioreq has not already
been marked as mapped).

The frontend user can therefore force xen_disk to leak grant mappings, a
per-domain limited resource.

Fix by marking the ioreq as mapped before calling ioreq_unmap in this
situation.

Signed-off-by: Matthew Daley <mattjd@gmail.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(cherry picked from commit a76f48e533)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-12-03 14:07:20 -06:00
..
dataplane dataplane: refuse to start if device is already in use 2013-07-29 17:19:15 +02:00
Makefile.objs pc_sysfw: do not make it a device anymore 2013-08-12 09:31:14 -05:00
block.c
cdrom.c
ecc.c
fdc.c fdc: Fix inheritence for SUNW,fdtwo 2013-07-29 20:41:13 +02:00
hd-geometry.c
m25p80.c block/m25p80: Update Micron entries 2013-07-19 12:52:03 +04:00
nand.c nand: Don't inherit from Sysbus 2013-06-25 19:15:46 +01:00
nvme.c devices: Associate devices to their logical category 2013-07-29 10:37:09 -05:00
nvme.h NVMe: Initial commit for new storage interface 2013-06-17 17:47:59 +02:00
onenand.c onenand: QOM cast cleanup 2013-07-29 21:05:58 +02:00
pflash_cfi01.c devices: Associate devices to their logical category 2013-07-29 10:37:09 -05:00
pflash_cfi02.c pflash_cfi02: Use QOM realize for pflash_cfi02 2013-07-23 00:37:35 +02:00
tc58128.c hw: move block devices to hw/block/, configure via default-configs/ 2013-04-08 18:13:13 +02:00
virtio-blk.c virtio-blk: do not relay a previous driver's WCE configuration to the current 2013-09-24 23:03:09 -05:00
xen_blkif.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
xen_disk.c xen_disk: mark ioreq as mapped before unmapping in error case 2013-12-03 14:07:20 -06:00