xemu/hw/char
David Gibson 0f888bfadd spapr_vty: lookup should only return valid VTY objects
If a guest passes the reg property of a valid VIO object that is not a VTY
to either H_GET_TERM_CHAR or H_PUT_TERM_CHAR, QEMU hits a dynamic cast
assertion and aborts.

PAPR+ says "Hypervisor checks the termno parameter for validity against the
Vterm IOA unit addresses assigned to the partition, else return H_Parameter."

This patch adds a type check to ensure vty_lookup() either returns a pointer
to a valid VTY object or NULL.  H_GET_TERM_CHAR and H_PUT_TERM_CHAR will
now return H_PARAMETER to the guest instead of crashing.

The patch has no effect on the reg == 0 hack used to implement the RTAS call
display-character.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
2015-07-07 17:44:53 +02:00
..
cadence_uart.c char: cadence_uart: Split state struct and type into header 2015-05-18 16:41:12 +01:00
debugcon.c qdev: Remove hex8/32/64 property types 2014-02-14 21:12:04 +01:00
digic-uart.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00
escc.c savevm: Remove all the unneeded version_minimum_id_old (ppc) 2014-06-16 04:55:26 +02:00
etraxfs_ser.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00
exynos4210_uart.c savevm: Remove all the unneeded version_minimum_id_old (arm) 2014-05-13 16:09:35 +01:00
grlib_apbuart.c grlib_apbuart: QOM cast cleanup 2013-07-29 21:06:27 +02:00
imx_serial.c savevm: Remove all the unneeded version_minimum_id_old (arm) 2014-05-13 16:09:35 +01:00
ipoctal232.c savevm: Remove all the unneeded version_minimum_id_old (rest) 2014-05-14 15:24:51 +02:00
lm32_juart.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00
lm32_uart.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00
Makefile.objs stm32f2xx_USART: Add the stm32f2xx USART Controller 2015-03-11 13:21:05 +00:00
mcf_uart.c memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
milkymist-uart.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00
omap_uart.c omap: Fix warnings from Sparse 2015-03-19 11:11:55 +03:00
parallel.c Move parallel_hds_isa_init to hw/isa/isa-bus.c 2015-06-05 17:09:58 +02:00
pl011.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00
sclpconsole-lm.c sclp: sort into categories 2015-04-30 13:21:41 +02:00
sclpconsole.c sclp: sort into categories 2015-04-30 13:21:41 +02:00
serial-isa.c serial: serial_hds_isa_init() shouldn't fail 2015-02-24 00:19:06 +01:00
serial-pci.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
serial.c migration: Use normal VMStateDescriptions for Subsections 2015-06-12 06:53:57 +02:00
sh_serial.c sh4: Fix serial line access for Linux kernels later than 3.2 2013-10-02 22:55:28 +04:00
spapr_vty.c spapr_vty: lookup should only return valid VTY objects 2015-07-07 17:44:53 +02:00
stm32f2xx_usart.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00
virtio-console.c virtio-console: notify chardev when writable 2015-05-29 09:56:01 +02:00
virtio-serial-bus.c qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
xen_console.c sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
xilinx_uartlite.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00