1
0
Fork 0
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
..
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 Merge branches 'x86/amd', 'x86/vt-d', 'arm/exynos', 'arm/mediatek', 'arm/msm', 'arm/rockchip', 'arm/smmu' and 'core' into next 2016-07-26 16:02:37 +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 powerpc/fsl: Move fsl_guts.h out of arch/powerpc 2015-10-21 18:05:50 -05:00
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 iommu/fsl: Convert to device_group call-back 2015-10-22 00:00:49 +02:00
fsl_pamu_domain.h iommu/fsl: Make use of domain_alloc and domain_free 2015-03-31 15:32:14 +02:00
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 iommu/io-pgtable: Fix a brace coding style issue. 2016-04-05 15:34:29 +02:00
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: Add iommu_error class event to iommu trace 2013-09-25 11:07:04 +02:00
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 x86/cpufeature: Replace cpu_has_apic with boot_cpu_has() usage 2016-04-13 11:37:41 +02:00
irq_remapping.h iommu, x86: Setup Posted-Interrupts capability for Intel iommu 2015-06-12 11:33:52 +02:00
msm_iommu.c iommu: Remove iommu_register_instance interface 2017-02-10 14:54:37 +01:00
msm_iommu.h iommu/msm: Make use of iommu_device_register interface 2017-02-10 13:44:57 +01:00
msm_iommu_hw-8xxx.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
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 iommu/omap: Align code with open parenthesis 2016-04-05 17:53:20 +02:00
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 iommu/omap: Use BIT(x) macros in omap-iopgtable.h 2015-08-03 16:04:42 +02:00
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 Merge branches 'iommu/fixes', 'x86/vt-d', 'x86/amd', 'arm/smmu', 'arm/tegra' and 'core' into next 2015-04-02 13:33:19 +02:00
tegra-smmu.c iommu: Remove pci.h include from trace/events/iommu.h 2017-04-29 00:20:49 +02:00