linux/arch/x86
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
..
boot x86: link vdso and boot with -z noexecstack --no-warn-rwx-segments 2022-08-21 15:15:18 +02:00
configs
crypto crypto: x86/poly1305 - Fixup SLS 2022-07-25 11:26:32 +02:00
entry x86/entry: Build thunk_$(BITS) only if CONFIG_PREEMPTION=y 2022-08-21 15:16:13 +02:00
events perf/x86/intel/pt: Fix sampling using single range output 2022-11-25 17:45:54 +01:00
hyperv
ia32
include x86/cpu: Restore AMD's DE_CFG MSR after resume 2022-11-16 09:57:20 +01:00
kernel x86/cpu: Restore AMD's DE_CFG MSR after resume 2022-11-16 09:57:20 +01:00
kvm KVM: x86: remove exit_int_info warning in svm_handle_exit 2022-12-02 17:40:04 +01:00
lib x86/retbleed: Add fine grained Kconfig knobs 2022-07-25 11:26:50 +02:00
math-emu x86: Prepare asm files for straight-line-speculation 2022-07-25 11:26:28 +02:00
mm x86/ioremap: Fix page aligned size calculation in __ioremap_caller() 2022-12-02 17:40:04 +01:00
net x86/bpf: Use alternative RET encoding 2022-07-25 11:26:38 +02:00
oprofile
pci x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests 2022-05-09 09:05:00 +02:00
platform x86/olpc: fix 'logical not is only applied to the left hand side' 2022-08-21 15:16:14 +02:00
power x86/cpu: Restore AMD's DE_CFG MSR after resume 2022-11-16 09:57:20 +01:00
purgatory
ras
realmode
tools
um arch: um: Mark the stack non-executable to fix a binutils warning 2022-10-15 07:55:53 +02:00
video
xen x86/entry: Work around Clang __bdos() bug 2022-10-26 13:25:45 +02:00
.gitignore
Kbuild
Kconfig x86/Kconfig: Drop check for -mabi=ms for CONFIG_EFI_STUB 2022-10-30 09:41:19 +01:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug
Makefile x86/realmode: build with -D__DISABLE_EXPORTS 2022-07-25 11:26:33 +02:00
Makefile_32.cpu
Makefile.um