android_kernel_samsung_msm8226/arch/x86/mm
Kees Cook 2216293b25 mm: Tighten x86 /dev/mem with zeroing reads
Under CONFIG_STRICT_DEVMEM, reading System RAM through /dev/mem is
disallowed. However, on x86, the first 1MB was always allowed for BIOS
and similar things, regardless of it actually being System RAM. It was
possible for heap to end up getting allocated in low 1MB RAM, and then
read by things like x86info or dd, which would trip hardened usercopy:

usercopy: kernel memory exposure attempt detected from ffff880000090000 (dma-kmalloc-256) (4096 bytes)

This changes the x86 exception for the low 1MB by reading back zeros for
System RAM areas instead of blindly allowing them. More work is needed to
extend this to mmap, but currently mmap doesn't go through usercopy, so
hardened usercopy won't Oops the kernel.

Change-Id: I6732f317b537c96046427bdcf805803dc138129a
Reported-by: Tommi Rantala <tommi.t.rantala@nokia.com>
Tested-by: Tommi Rantala <tommi.t.rantala@nokia.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
CVE-2017-7889
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2019-08-06 12:26:39 +02:00
..
kmemcheck
Makefile
amdtopology.c
dump_pagetables.c
extable.c
fault.c
gup.c
highmem_32.c
hugetlbpage.c mm: larger stack guard gap, between vmas 2019-08-06 12:26:29 +02:00
init.c mm: Tighten x86 /dev/mem with zeroing reads 2019-08-06 12:26:39 +02:00
init_32.c
init_64.c
iomap_32.c
ioremap.c
kmmio.c
memtest.c
mmap.c
mmio-mod.c
numa.c
numa_32.c
numa_64.c
numa_emulation.c
numa_internal.h
pageattr-test.c
pageattr.c
pat.c
pat_internal.h
pat_rbtree.c
pf_in.c
pf_in.h
pgtable.c
pgtable_32.c
physaddr.c
physaddr.h
setup_nx.c
srat.c
testmmiotrace.c
tlb.c