linux/arch
Michael Kelley 22870431cd x86/ioremap: Fix page aligned size calculation in __ioremap_caller()
commit 4dbd6a3e90 upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-12-02 17:40:04 +01:00
..
alpha
arc arc: iounmap() arg is volatile 2022-11-03 23:57:51 +09:00
arm ARM: dts: imx6q-prti6q: Fix ref/tcxo-clock-frequency properties 2022-12-02 17:40:00 +01:00
arm64 arm64: dts: rockchip: lower rk3399-puma-haikou SD controller clock frequency 2022-12-02 17:40:02 +01:00
c6x
csky
h8300
hexagon
ia64
m68k
microblaze
mips MIPS: pic32: treat port as signed integer 2022-12-02 17:39:58 +01:00
nds32
nios2 nios2: add FORCE for vmlinuz.gz 2022-12-02 17:40:03 +01:00
openrisc
parisc parisc: Avoid printing the hardware path twice 2022-11-10 18:14:27 +01:00
powerpc
riscv RISC-V: vdso: Do not add missing symbols to version section in linker script 2022-12-02 17:39:58 +01:00
s390 s390/crashdump: fix TOD programmable field size 2022-12-02 17:40:02 +01:00
sh
sparc
um
x86 x86/ioremap: Fix page aligned size calculation in __ioremap_caller() 2022-12-02 17:40:04 +01:00
xtensa
.gitignore
Kconfig