1
0
Fork 0
alistair23-linux/arch/powerpc/mm
Alexey Kardashevskiy f211830829 powerpc/book3s64: Fix error handling in mm_iommu_do_alloc()
[ Upstream commit c4b78169e3 ]

The last jump to free_exit in mm_iommu_do_alloc() happens after page
pointers in struct mm_iommu_table_group_mem_t were already converted to
physical addresses. Thus calling put_page() on these physical addresses
will likely crash.

This moves the loop which calculates the pageshift and converts page
struct pointers to physical addresses later after the point when
we cannot fail; thus eliminating the need to convert pointers back.

Fixes: eb9d7a62c3 ("powerpc/mm_iommu: Fix potential deadlock")
Reported-by: Jan Kara <jack@suse.cz>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191223060351.26359-1-aik@ozlabs.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 13:17:38 +02:00
..
book3s32 powerpc/32s: Don't warn when mapping RO data ROX. 2020-06-24 17:50:34 +02:00
book3s64 powerpc/book3s64: Fix error handling in mm_iommu_do_alloc() 2020-10-01 13:17:38 +02:00
kasan Revert "powerpc/kasan: Fix shadow pages allocation failure" 2020-08-11 15:33:39 +02:00
nohash powerpc/fsl_booke: Avoid creating duplicate tlb1 entry 2020-04-17 10:50:22 +02:00
ptdump powerpc/ptdump: Fix build failure in hashpagetable.c 2020-08-21 13:05:24 +02:00
Makefile powerpc/mm: Move ioremap functions out of pgtable_32/64.c 2019-08-27 13:03:35 +10:00
copro_fault.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 153 2019-05-30 11:26:32 -07:00
dma-noncoherent.c powerpc updates for 5.4 2019-09-20 11:48:06 -07:00
drmem.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fault.c powerpc: Allow 4224 bytes of stack expansion for the signal frame 2020-08-21 13:05:24 +02:00
highmem.c powerpc/highmem: Change BUG_ON() to WARN_ON() 2019-04-20 22:02:11 +10:00
hugetlbpage.c powerpc/hugetlb: Fix 512k hugepages on 8xx with 16k page size 2020-02-28 17:22:18 +01:00
init-common.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
init_32.c Revert "powerpc/kasan: Fix shadow pages allocation failure" 2020-08-11 15:33:39 +02:00
init_64.c powerpc/book3s64/radix: Fix boot failure with large amount of guest memory 2020-09-23 12:40:39 +02:00
ioremap.c powerpc/mm: split out early ioremap path. 2019-08-27 13:03:35 +10:00
ioremap_32.c powerpc/mm: split out early ioremap path. 2019-08-27 13:03:35 +10:00
ioremap_64.c powerpc/mm: split out early ioremap path. 2019-08-27 13:03:35 +10:00
mem.c powerpc/mm: Fix missing KUAP disable in flush_coherent_icache() 2020-03-12 13:00:25 +01:00
mmap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
mmu_context.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mmu_decl.h powerpc/mm: make ioremap_bot common to all 2019-08-27 13:03:34 +10:00
numa.c powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
pgtable-frag.c mm: treewide: clarify pgtable_page_{ctor,dtor}() naming 2019-09-26 10:10:44 -07:00
pgtable.c powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
pgtable_32.c powerpc/mm: Fix conditions to perform MMU specific management by blocks on PPC32. 2020-06-22 09:31:13 +02:00
pgtable_64.c powerpc/mm: Move ioremap functions out of pgtable_32/64.c 2019-08-27 13:03:35 +10:00
slice.c powerpc/mm: Mark get_slice_psize() & slice_addr_is_low() as notrace 2020-01-09 10:20:04 +01:00