linux-stable/arch
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
..
alpha tty: the rest, stop using tty_schedule_flip() 2022-07-29 17:14:19 +02:00
arc arc: iounmap() arg is volatile 2022-11-03 23:56:54 +09:00
arm ARM: mxs: fix memory leak in mxs_machine_init() 2022-12-08 11:22:58 +01:00
arm64 arm64: errata: Fix KVM Spectre-v2 mitigation selection for Cortex-A57/A72 2022-12-08 11:23:04 +01:00
c6x
csky
h8300
hexagon
ia64 ia64, processor: fix -Wincompatible-pointer-types in ia64_get_irr() 2022-08-25 11:17:25 +02:00
m68k m68k: use fallback for random_get_entropy() instead of zero 2022-06-22 14:11:15 +02:00
microblaze uaccess: fix nios2 and microblaze get_user_8() 2022-04-15 14:18:08 +02:00
mips MIPS: pic32: treat port as signed integer 2022-12-08 11:22:57 +01:00
nds32 nds32: fix access_ok() checks in get/put_user 2022-03-28 08:46:48 +02:00
nios2 nios2: add FORCE for vmlinuz.gz 2022-12-08 11:22:59 +01:00
openrisc openrisc: start CPU timer early in boot 2022-06-14 18:11:28 +02:00
parisc parisc: Avoid printing the hardware path twice 2022-11-10 17:57:56 +01:00
powerpc powerpc: Fix SPE Power ISA properties for e500v1 platforms 2022-10-26 13:22:45 +02:00
riscv RISC-V: vdso: Do not add missing symbols to version section in linker script 2022-12-08 11:22:57 +01:00
s390 s390/crashdump: fix TOD programmable field size 2022-12-08 11:22:59 +01:00
sh sh: machvec: Use char[] for section boundaries 2022-10-26 13:22:21 +02:00
sparc sparc: use fallback for random_get_entropy() instead of zero 2022-06-22 14:11:15 +02:00
um UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-10-26 13:22:16 +02:00
unicore32
x86 x86/ioremap: Fix page aligned size calculation in __ioremap_caller() 2022-12-08 11:23:06 +01:00
xtensa xtensa: Fix refcount leak bug in time.c 2022-06-29 08:58:48 +02:00
.gitignore
Kconfig locking/refcount: Consolidate implementations of refcount_t 2022-07-29 17:14:17 +02:00