linux-stable/arch/x86/mm
Michael Kelley e67e119adf x86/ioremap: Fix page aligned size calculation in __ioremap_caller()
[ Upstream commit 4dbd6a3e90 ]

Current code re-calculates the size after aligning the starting and
ending physical addresses on a page boundary. But the re-calculation
also embeds the masking of high order bits that exceed the size of
the physical address space (via PHYSICAL_PAGE_MASK). If the masking
removes any high order bits, the size calculation results in a huge
value that is likely to immediately fail.

Fix this by re-calculating the page-aligned size first. Then mask any
high order bits using PHYSICAL_PAGE_MASK.

Fixes: ffa71f33a8 ("x86, ioremap: Fix incorrect physical address handling in PAE mode")
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/r/1668624097-14884-2-git-send-email-mikelley@microsoft.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-08 11:23:06 +01:00
..
Makefile treewide: prefix header search paths with $(srctree)/ 2019-05-18 11:49:57 +09:00
amdtopology.c
cpu_entry_area.c x86/pti/32: Calculate the various PTI cpu_entry_area sizes correctly, make the CPU_ENTRY_AREA_PAGES assert precise 2019-11-29 10:10:00 +01:00
debug_pagetables.c x86: mm: no need to check return value of debugfs_create functions 2019-06-03 16:18:12 +02:00
dump_pagetables.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
extable.c locking/refcount: Consolidate implementations of refcount_t 2022-07-29 17:14:17 +02:00
fault.c x86/mm: split vmalloc_sync_all() 2020-03-25 08:25:58 +01:00
highmem_32.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
hugetlbpage.c mm: simplify MEMORY_ISOLATION && COMPACTION || CMA into CONTIG_ALLOC 2019-05-14 09:47:47 -07:00
ident_map.c x86/mm/ident_map: Check for errors from ident_pud_init() 2020-12-30 11:51:02 +01:00
init.c x86/mm: Stop printing BRK addresses 2020-06-22 09:31:08 +02:00
init_32.c mm/memory_hotplug: shrink zones when offlining memory 2020-01-09 10:19:56 +01:00
init_64.c x86/mm: Fix kern_addr_valid() to cope with existing but not present entries 2021-09-22 12:26:40 +02:00
iomap_32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ioremap.c x86/ioremap: Fix page aligned size calculation in __ioremap_caller() 2022-12-08 11:23:06 +01:00
kasan_init_64.c x86/kasan: Fix boot with 5-level paging and KASAN 2019-06-14 16:37:30 +02:00
kaslr.c x86/mm/KASLR: Compute the size of the vmemmap section properly 2019-06-07 23:12:13 +02:00
kmmio.c
mem_encrypt.c x86/mem_encrypt: Correct physical address calculation in __set_clr_pte_enc() 2021-03-30 14:35:29 +02:00
mem_encrypt_boot.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mem_encrypt_identity.c x86/sme: Use #define USE_EARLY_PGTABLE_L5 in mem_encrypt_identity.c 2021-11-17 09:48:19 +01:00
mm_internal.h x86/mm: Do not use set_{pud, pmd}_safe() when splitting a large page 2019-05-08 19:08:35 +02:00
mmap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
mmio-mod.c x86/mmiotrace: Use cpumask_available() for cpumask_var_t variables 2020-06-07 13:18:51 +02:00
mpx.c signal: Remove task parameter from force_sig 2019-05-27 09:36:28 -05:00
numa.c x86/numa: Use cpumask_available instead of hardcoded NULL check 2022-08-25 11:18:08 +02:00
numa_32.c
numa_64.c
numa_emulation.c x86, fakenuma: Fix invalid starting node ID 2020-09-09 19:12:28 +02:00
numa_internal.h
pageattr-test.c
pageattr.c x86/mm/pat: Don't flush cache if hardware enforces cache coherency across encryption domnains 2022-03-16 13:21:48 +01:00
pat.c x86: Fix return value of __setup handlers 2022-06-14 18:11:35 +02:00
pat_internal.h
pat_rbtree.c augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro 2019-09-25 17:51:39 -07:00
pf_in.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pf_in.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pgtable.c x86/mm: Fix leak of pmd ptlock 2021-01-12 20:16:22 +01:00
pgtable_32.c
physaddr.c
physaddr.h
pkeys.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
pti.c x86/mm/pti: Do not invoke PTI functions when PTI is disabled 2019-08-29 20:52:53 +02:00
setup_nx.c
srat.c
testmmiotrace.c x86/mmiotrace: Lock down the testmmiotrace module 2019-08-19 21:54:16 -07:00
tlb.c x86/membarrier: Get rid of a dubious optimization 2020-12-16 10:56:59 +01:00