linux-next/include
Christoph Hellwig 566fb90e05 swiotlb-xen: fix DMA_ATTR_NO_KERNEL_MAPPING on arm
swiotlb-xen uses very different ways to allocate coherent memory on x86
vs arm.  On the former it allocates memory from the page allocator, while
on the later it reuses the dma-direct allocator the handles the
complexities of non-coherent DMA on arm platforms.

Unfortunately the complexities of trying to deal with the two cases in
the swiotlb-xen.c code lead to a bug in the handling of
DMA_ATTR_NO_KERNEL_MAPPING on arm.  With the DMA_ATTR_NO_KERNEL_MAPPING
flag the coherent memory allocator does not actually allocate coherent
memory, but just a DMA handle for some memory that is DMA addressable
by the device, but which does not have to have a kernel mapping.  Thus
dereferencing the return value will lead to kernel crashed and memory
corruption.

Fix this by using the dma-direct allocator directly for arm, which works
perfectly fine because on arm swiotlb-xen is only used when the domain is
1:1 mapped, and then simplifying the remaining code to only cater for the
x86 case with DMA coherent device.

Reported-by: Rahul Singh <Rahul.Singh@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Rahul Singh <rahul.singh@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Tested-by: Rahul Singh <rahul.singh@arm.com>
2022-05-11 19:48:32 +02:00
..
acpi ACPI: bus: Eliminate acpi_bus_get_device() 2022-04-05 19:49:26 +02:00
asm-generic block-5.18-2022-04-15 2022-04-15 11:38:55 -07:00
clocksource clocksource/drivers/arm_arch_timer: Use event stream scaling when available 2022-03-07 18:27:22 +01:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2022-03-21 16:02:36 -07:00
drm drm-misc-next for v5.18: 2022-03-04 13:41:57 +10:00
dt-bindings RTC for 5.18 2022-04-01 09:37:18 -07:00
keys KEYS: Introduce link restriction for machine keys 2022-03-08 13:55:52 +02:00
kunit
kvm Merge branch kvm-arm64/psci-1.1 into kvmarm-master/next 2022-02-25 13:49:48 +00:00
linux swiotlb: remove swiotlb_init_with_tbl and swiotlb_init_late_with_tbl 2022-04-18 07:21:14 +02:00
math-emu
media media: m5mols: Convert to use GPIO descriptors 2022-03-04 09:36:26 +02:00
memory
misc
net net/sched: flower: fix parsing of ethertype following VLAN header 2022-04-08 12:07:37 +01:00
pcmcia
ras mm/memory-failure.c: fix race with changing page compound again 2022-03-22 15:57:07 -07:00
rdma uaccess: remove CONFIG_SET_FS 2022-02-25 09:36:06 +01:00
scsi scsi: iscsi: Fix NOP handling during conn recovery 2022-04-11 22:09:35 -04:00
soc drm for 5.18-rc1 2022-03-24 16:19:43 -07:00
sound sound fixes for 5.18-rc3 2022-04-14 11:08:12 -07:00
target scsi: target: Add iscsi/cpus_allowed_list in configfs 2022-03-14 23:40:36 -04:00
trace swiotlb: make the swiotlb_init interface more useful 2022-04-18 07:21:11 +02:00
uapi io_uring-5.18-2022-04-14 2022-04-15 11:33:20 -07:00
vdso
video drm/exynos: fimd: add BGR support for exynos4/5 2022-03-04 17:13:52 +09:00
xen swiotlb-xen: fix DMA_ATTR_NO_KERNEL_MAPPING on arm 2022-05-11 19:48:32 +02:00