qemu-e2k/hw/vfio
Alex Williamson 85b6d2b5fc vfio/common: Fix vfio_iommu_type1_info use after free
On error, vfio_get_iommu_info() frees and clears *info, but
vfio_connect_container() continues to use the pointer regardless
of the return value.  Restructure the code such that a failure
of this function triggers an error and clean up the remainder of
the function, including updating an outdated comment that had
drifted from its relevant line of code and using host page size
for a default for better compatibility on non-4KB systems.

Reported-by: Nicolin Chen <nicolinc@nvidia.com>
Link: https://lore.kernel.org/all/20220910004245.2878-1-nicolinc@nvidia.com/
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Link: https://lore.kernel.org/r/166326219630.3388898.12882473157184946072.stgit@omen
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2022-09-27 14:26:42 -06:00
..
amd-xgbe.c
ap.c
calxeda-xgmac.c
ccw.c
common.c vfio/common: Fix vfio_iommu_type1_info use after free 2022-09-27 14:26:42 -06:00
display.c ui/console: Do not return a value with ui_info 2022-06-14 10:34:37 +02:00
igd.c
Kconfig
meson.build
migration.c vfio/migration: Fix incorrect initialization value for parameters in VFIOMigration 2022-09-27 14:26:39 -06:00
pci-quirks.c
pci.c
pci.h
platform.c
spapr.c
trace-events vfio/common: remove spurious warning on vfio_listener_region_del 2022-06-08 08:44:19 -06:00
trace.h