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 tty: the rest, stop using tty_schedule_flip() 2022-07-29 17:19:28 +02:00
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 csky/kprobe: reclaim insn_slot on kprobe unregistration 2022-08-25 11:38:16 +02:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-17 11:02:28 +01:00
hexagon hexagon: select ARCH_WANT_LD_ORPHAN_WARN 2022-08-21 15:15:33 +02:00
ia64 ia64: export memory_add_physaddr_to_nid to fix cxl build error 2022-10-26 13:25:29 +02:00
m68k Revert "m68knommu: only set CONFIG_ISA_DMA_API for ColdFire sub-arch" 2022-07-29 17:19:09 +02:00
microblaze uaccess: fix nios2 and microblaze get_user_8() 2022-04-08 14:40:08 +02:00
mips MIPS: pic32: treat port as signed integer 2022-12-02 17:39:58 +01:00
nds32 nds32: fix access_ok() checks in get/put_user 2022-03-28 09:57:10 +02:00
nios2 nios2: add FORCE for vmlinuz.gz 2022-12-02 17:40:03 +01:00
openrisc openrisc: start CPU timer early in boot 2022-06-09 10:20:55 +02:00
parisc parisc: Avoid printing the hardware path twice 2022-11-10 18:14:27 +01:00
powerpc powerpc: Fix SPE Power ISA properties for e500v1 platforms 2022-10-26 13:25:41 +02:00
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 sh: machvec: Use char[] for section boundaries 2022-10-26 13:25:17 +02:00
sparc sparc: use fallback for random_get_entropy() instead of zero 2022-05-30 09:33:42 +02:00
um UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-10-26 13:25:10 +02:00
x86 x86/ioremap: Fix page aligned size calculation in __ioremap_caller() 2022-12-02 17:40:04 +01:00
xtensa xtensa: iss: fix handling error cases in iss_net_configure() 2022-08-21 15:15:59 +02:00
.gitignore
Kconfig arch/cc: Introduce a function to check for confidential computing features 2021-11-18 14:04:32 +01:00