qemu-patch-raspberry4/hw/i2c
Prasad J Pandit f2609ffdf3 i2c: pm_smbus: check smb_index before block transfer write
While performing block transfer write in smb_ioport_writeb(),
'smb_index' is incremented and used to index smb_data[] array.
Check 'smb_index' value to avoid OOB access.

Note that this bug is exploitable by a guest to escape
from the virtual machine. However the commit which
introduced the bug was only made after the 3.0 release,
and so it is not present in any released QEMU versions.

Fixes: 38ad4fae43 i2c: pm_smbus: Add block transfer capability
Reported-by: Michael Hanselmann <public@hansmi.ch>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 20181206121830.6177-1-ppandit@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-12-06 15:51:57 +00:00
..
aspeed_i2c.c aspeed/i2c: Fix receive done interrupt handling 2018-09-25 14:14:07 +01:00
bitbang_i2c.c
bitbang_i2c.h
core.c
exynos4210_i2c.c
i2c-ddc.c i2c: switch ddc to use the new edid generator 2018-10-15 09:57:33 +02:00
imx_i2c.c
Makefile.objs
omap_i2c.c hw/i2c/omap_i2c: Use qemu_log_mask(UNIMP) instead of fprintf 2018-06-26 17:50:40 +01:00
pm_smbus.c i2c: pm_smbus: check smb_index before block transfer write 2018-12-06 15:51:57 +00:00
ppc4xx_i2c.c ppc4xx_i2c: Rewrite to model hardware more closely 2018-07-03 09:56:52 +10:00
smbus.c i2c: Add a length check to the SMBus write handling 2018-12-03 13:00:38 +00:00
smbus_eeprom.c
smbus_ich9.c i2c: pm_smbus: Add the ability to force block transfer enable 2018-08-23 18:46:25 +02:00
trace-events
versatile_i2c.c