linux-stable/include
Lu Baolu 7388ae6f26 iommu: Return right value in iommu_sva_bind_device()
[ Upstream commit 89e8a2366e ]

iommu_sva_bind_device() should return either a sva bond handle or an
ERR_PTR value in error cases. Existing drivers (idxd and uacce) only
check the return value with IS_ERR(). This could potentially lead to
a kernel NULL pointer dereference issue if the function returns NULL
instead of an error pointer.

In reality, this doesn't cause any problems because iommu_sva_bind_device()
only returns NULL when the kernel is not configured with CONFIG_IOMMU_SVA.
In this case, iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_SVA) will
return an error, and the device drivers won't call iommu_sva_bind_device()
at all.

Fixes: 26b25a2b98 ("iommu: Bind process address spaces to devices")
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20240528042528.71396-1-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-21 14:38:30 +02:00
..
acpi ACPI: x86: Move acpi_quirk_skip_serdev_enumeration() out of CONFIG_X86_ANDROID_TABLETS 2024-04-13 13:07:31 +02:00
asm-generic sched: Add missing memory barrier in switch_mm_cid 2024-04-27 17:11:41 +02:00
clocksource
crypto crypto: af_alg - Disallow multiple in-flight AIO requests 2024-01-25 15:35:16 -08:00
drm drm/edid: Parse topology block for all DispID structure v1.x 2024-06-12 11:12:05 +02:00
dt-bindings clk: renesas: r8a779g0: Correct PFC/GPIO parent clocks 2024-03-26 18:19:47 -04:00
keys
kunit
kvm KVM: arm64: Fix host-programmed guest events in nVHE 2024-04-10 16:35:48 +02:00
linux iommu: Return right value in iommu_sva_bind_device() 2024-06-21 14:38:30 +02:00
math-emu
media media: cec: core: avoid recursive cec_claim_log_addrs 2024-06-12 11:12:43 +02:00
memory
misc
net net: fix __dst_negative_advice() race 2024-06-16 13:47:44 +02:00
pcmcia
ras
rdma RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz 2023-12-13 18:45:16 +01:00
rv
scsi scsi: mpi3mr: Fix ATA NCQ priority support 2024-06-21 14:38:25 +02:00
soc soc: qcom: rpmh-rsc: Enhance check for VRM in-flight request 2024-06-16 13:47:33 +02:00
sound ASoC: tas2781: Fix wrong loading calibrated data sequence 2024-06-12 11:12:47 +02:00
target
trace cachefiles: fix slab-use-after-free in cachefiles_ondemand_daemon_read() 2024-06-21 14:38:27 +02:00
uapi drm/nouveau: use tile_mode and pte_kind for VM_BIND bo allocations 2024-06-12 11:12:45 +02:00
ufs
vdso
video fbdev: stifb: Make the STI next font pointer a 32-bit signed offset 2023-11-28 17:19:58 +00:00
xen xen/events: reduce externally visible helper functions 2024-03-01 13:34:57 +01:00