linux-stable/drivers/iommu
Linus Torvalds e6bbad7571 mm: always expand the stack with the mmap write lock held
commit 8d7071af89 upstream

This finishes the job of always holding the mmap write lock when
extending the user stack vma, and removes the 'write_locked' argument
from the vm helper functions again.

For some cases, we just avoid expanding the stack at all: drivers and
page pinning really shouldn't be extending any stacks.  Let's see if any
strange users really wanted that.

It's worth noting that architectures that weren't converted to the new
lock_mm_and_find_vma() helper function are left using the legacy
"expand_stack()" function, but it has been changed to drop the mmap_lock
and take it for writing while expanding the vma.  This makes it fairly
straightforward to convert the remaining architectures.

As a result of dropping and re-taking the lock, the calling conventions
for this function have also changed, since the old vma may no longer be
valid.  So it will now return the new vma if successful, and NULL - and
the lock dropped - if the area could not be extended.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[6.1: Patch drivers/iommu/io-pgfault.c instead]
Signed-off-by: Samuel Mendoza-Jonas <samjonas@amazon.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-01 13:16:25 +02:00
..
amd mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
arm iommu/arm-smmu: Report IOMMU_CAP_CACHE_COHERENCY even betterer 2023-01-18 11:58:21 +01:00
intel iommu/vt-d: Allow zero SAGAW if second-stage not supported 2023-04-06 12:10:49 +02:00
Kconfig Merge branches 'apple/dart', 'arm/mediatek', 'arm/omap', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-09-26 15:52:31 +02:00
Makefile iommu/io-pgtable: Move Apple DART support to its own file 2022-09-26 13:48:40 +02:00
apple-dart.c iommu/dart: Fix apple_dart_device_group for PCI groups 2023-03-10 09:33:36 +01:00
dma-iommu.c iommu/dma: Make header private 2022-09-09 09:26:22 +02:00
dma-iommu.h iommu/dma: Make header private 2022-09-09 09:26:22 +02:00
exynos-iommu.c iommu/exynos: Clean up bus_set_iommu() 2022-09-07 14:26:14 +02:00
fsl_pamu.c iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe() 2022-12-31 13:32:50 +01:00
fsl_pamu.h
fsl_pamu_domain.c iommu: Clean up bus_set_iommu() 2022-09-07 14:26:17 +02:00
fsl_pamu_domain.h
hyperv-iommu.c iommu/hyper-v: Use helper instead of directly accessing affinity 2022-08-04 10:02:09 +01:00
io-pgfault.c mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Add a quirk to allow pgtable PA up to 35bit 2022-07-07 09:42:59 +02:00
io-pgtable-arm.c Merge branches 'apple/dart', 'arm/mediatek', 'arm/omap', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-09-26 15:52:31 +02:00
io-pgtable-arm.h
io-pgtable-dart.c iommu/io-pgtable-dart: Add DART PTE support for t6000 2022-09-26 13:49:40 +02:00
io-pgtable.c Merge branches 'apple/dart', 'arm/mediatek', 'arm/omap', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-09-26 15:52:31 +02:00
ioasid.c
iommu-debugfs.c
iommu-sva-lib.c
iommu-sva-lib.h
iommu-sysfs.c
iommu-traces.c
iommu.c iommu/amd: Set page size bitmap during V2 domain allocation 2023-05-11 23:03:34 +09:00
iova.c iommu/iova: Fix alloc iova overflows issue 2023-01-18 11:58:20 +01:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Clean up bus_set_iommu() 2022-09-07 14:26:14 +02:00
irq_remapping.c
irq_remapping.h
msm_iommu.c iommu: Clean up bus_set_iommu() 2022-09-07 14:26:17 +02:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu/mediatek: Flush IOTLB completely only if domain has been attached 2023-06-09 10:34:04 +02:00
mtk_iommu_v1.c iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe() 2023-01-18 11:58:21 +01:00
of_iommu.c Revert "iommu/of: Delete usage of driver_deferred_probe_check_state()" 2022-08-23 13:14:02 +02:00
omap-iommu-debug.c iommu/omap: Fix buffer overflow in debugfs 2022-09-07 10:42:28 +02:00
omap-iommu.c iommu/omap: Clean up bus_set_iommu() 2022-09-07 14:26:15 +02:00
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c iommu/rockchip: Fix unwind goto issue 2023-06-09 10:33:59 +02:00
s390-iommu.c iommu/s390: Fix duplicate domain attachments 2022-12-31 13:32:47 +01:00
sprd-iommu.c iommu: Clean up bus_set_iommu() 2022-09-07 14:26:17 +02:00
sun50i-iommu.c iommu/sun50i: Remove IOMMU_DOMAIN_IDENTITY 2022-12-31 13:32:51 +01:00
tegra-gart.c iommu: Make .release_device optional 2022-07-06 12:55:53 +02:00
tegra-smmu.c iommu/tegra-smmu: Clean up bus_set_iommu() 2022-09-07 14:26:16 +02:00
virtio-iommu.c iommu: Add gfp parameter to iommu_alloc_resv_region 2022-10-21 10:49:32 +02:00