alistair23-linux/drivers/iommu
Joerg Roedel 2926a2aa5c iommu: Fix wrong freeing of iommu_device->dev
The struct iommu_device has a 'struct device' embedded into
it, not as a pointer, but the whole struct. In the
conversion of the iommu drivers to use struct iommu_device
it was forgotten that the relase function for that struct
device simply calls kfree() on the pointer.

This frees memory that was never allocated and causes memory
corruption.

To fix this issue, use a pointer to struct device instead of
embedding the whole struct. This needs some updates in the
iommu sysfs code as well as the Intel VT-d and AMD IOMMU
driver.

Reported-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Fixes: 39ab9555c2 ('iommu: Add sysfs bindings for struct iommu_device')
Cc: stable@vger.kernel.org # >= v4.11
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2017-08-15 13:58:48 +02:00
..
amd_iommu.c iommu/amd: Enable ga_log_intr when enabling guest_mode 2017-07-25 15:03:55 +02:00
amd_iommu_init.c iommu/amd: Fix schedule-while-atomic BUG in initialization code 2017-07-26 15:39:14 +02:00
amd_iommu_proto.h x86/events, drivers/amd/iommu: Prepare for multiple IOMMUs support 2017-03-30 09:53:55 +02:00
amd_iommu_types.h iommu: Fix wrong freeing of iommu_device->dev 2017-08-15 13:58:48 +02:00
amd_iommu_v2.c iommu/amd: Fix incorrect error handling in amd_iommu_bind_pasid() 2017-04-24 12:33:34 +02:00
arm-smmu-v3.c iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126 2017-06-23 17:58:04 +01:00
arm-smmu.c iommu/arm-smmu: fix null-pointer dereference in arm_smmu_add_device 2017-08-11 16:56:51 +02:00
dma-iommu.c IOMMU Updates for Linux v4.13 2017-07-12 10:00:04 -07:00
dmar.c ACPI: Switch to use generic guid_t in acpi_evaluate_dsm() 2017-06-07 12:20:49 +02:00
exynos-iommu.c Merge branches 'arm/exynos', 'arm/omap', 'arm/rockchip', 'arm/mediatek', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd' and 'core' into next 2017-05-04 18:06:17 +02:00
fsl_pamu.c
fsl_pamu.h iommu: Remove pci.h include from trace/events/iommu.h 2017-04-29 00:20:49 +02:00
fsl_pamu_domain.c
fsl_pamu_domain.h
intel-iommu.c iommu: Fix wrong freeing of iommu_device->dev 2017-08-15 13:58:48 +02:00
intel-svm.c iommu/vt-d: Helper function to query if a pasid has any active users 2017-05-17 14:57:56 +02:00
intel_irq_remapping.c IOMMU Updates for Linux v4.13 2017-07-12 10:00:04 -07:00
io-pgtable-arm-v7s.c iommu/io-pgtable: Sanitise map/unmap addresses 2017-07-20 10:30:28 +01:00
io-pgtable-arm.c iommu/io-pgtable: Sanitise map/unmap addresses 2017-07-20 10:30:28 +01:00
io-pgtable.c
io-pgtable.h Revert "iommu/io-pgtable: Avoid redundant TLB syncs" 2017-07-20 10:30:27 +01:00
iommu-sysfs.c iommu: Fix wrong freeing of iommu_device->dev 2017-08-15 13:58:48 +02:00
iommu-traces.c
iommu.c iommu: Warn once when device_group callback returns NULL 2017-06-28 13:29:46 +02:00
iova.c Merge branches 'iommu/fixes', 'arm/rockchip', 'arm/renesas', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd', 's390' and 'core' into next 2017-06-28 14:45:02 +02:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Fix pgsize_bitmap semicolon typo 2017-05-17 15:21:58 +02:00
irq_remapping.c
irq_remapping.h
Kconfig Merge branches 'iommu/fixes', 'arm/rockchip', 'arm/renesas', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd', 's390' and 'core' into next 2017-06-28 14:45:02 +02:00
Makefile
msm_iommu.c
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu/mtk: Avoid redundant TLB syncs locally 2017-07-20 10:30:27 +01:00
mtk_iommu.h iommu/mtk: Avoid redundant TLB syncs locally 2017-07-20 10:30:27 +01:00
mtk_iommu_v1.c iommu/mediatek: Include linux/dma-mapping.h 2017-05-17 14:51:54 +02:00
of_iommu.c Merge branch 'WIP.sched/core' into sched/core 2017-06-20 12:28:21 +02:00
omap-iommu-debug.c
omap-iommu.c iommu/omap: Return ERR_PTR in device_group call-back 2017-06-28 13:29:45 +02:00
omap-iommu.h iommu/omap: Add iommu-group support 2017-04-20 16:33:59 +02:00
omap-iopgtable.h
rockchip-iommu.c Merge branches 'arm/exynos', 'arm/omap', 'arm/rockchip', 'arm/mediatek', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd' and 'core' into next 2017-05-04 18:06:17 +02:00
s390-iommu.c iommu/s390: Use iommu_group_get_for_dev() in s390_iommu_add_device() 2017-06-28 12:29:00 +02:00
tegra-gart.c
tegra-smmu.c iommu: Remove pci.h include from trace/events/iommu.h 2017-04-29 00:20:49 +02:00