linux/arch/x86
Craig Bergstrom ce56a86e2a x86/mm: Limit mmap() of /dev/mem to valid physical addresses
Currently, it is possible to mmap() any offset from /dev/mem.  If a
program mmaps() /dev/mem offsets outside of the addressable limits
of a system, the page table can be corrupted by setting reserved bits.

For example if you mmap() offset 0x0001000000000000 of /dev/mem on an
x86_64 system with a 48-bit bus, the page fault handler will be called
with error_code set to RSVD.  The kernel then crashes with a page table
corruption error.

This change prevents this page table corruption on x86 by refusing
to mmap offsets higher than the highest valid address in the system.

Signed-off-by: Craig Bergstrom <craigb@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: dsafonov@virtuozzo.com
Cc: kirill.shutemov@linux.intel.com
Cc: mhocko@suse.com
Cc: oleg@redhat.com
Link: http://lkml.kernel.org/r/20171019192856.39672-1-craigb@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-10-20 09:48:00 +02:00
..
boot
configs
crypto
entry x86/unwind: Use MSB for frame pointer encoding on 32-bit 2017-10-10 12:49:48 +02:00
events Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-10-14 15:16:49 -04:00
hyperv x86/hyperv: Fix hypercalls with extended CPU ranges for TLB flushing 2017-10-10 12:54:56 +02:00
ia32 x86/fpu: Rename fpu::fpstate_active to fpu::initialized 2017-09-26 09:43:36 +02:00
include x86/mm: Limit mmap() of /dev/mem to valid physical addresses 2017-10-20 09:48:00 +02:00
kernel x86/microcode/intel: Disable late loading on model 79 2017-10-18 15:20:20 +02:00
kvm KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit 2017-10-12 13:54:56 +02:00
lib
math-emu x86/fpu: Rename fpu__activate_curr() to fpu__initialize() 2017-09-26 09:43:44 +02:00
mm x86/mm: Limit mmap() of /dev/mem to valid physical addresses 2017-10-20 09:48:00 +02:00
net bpf: fix bpf_tail_call() x64 JIT 2017-10-03 16:04:44 -07:00
oprofile
pci
platform
power
purgatory
ras
realmode
tools
um
video
xen xen: fixes for 4.14 rc5 2017-10-13 11:35:03 -07:00
.gitignore
Kbuild
Kconfig
Kconfig.cpu
Kconfig.debug
Makefile
Makefile.um
Makefile_32.cpu