android_kernel_google_msm/arch
Kees Cook 159eb103ba 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: I27594af6146e7643217e3babcfd088592b7dbd4b
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>
2017-07-04 12:34:19 +03:00
..
alpha smp: Add task_struct argument to __cpu_up() 2016-10-29 23:12:38 +08:00
arm mm: larger stack guard gap, between vmas 2017-07-02 13:03:27 +03:00
avr32
blackfin smp: Add task_struct argument to __cpu_up() 2016-10-29 23:12:38 +08:00
c6x
cris smp: Add task_struct argument to __cpu_up() 2016-10-29 23:12:38 +08:00
frv mm: larger stack guard gap, between vmas 2017-07-02 13:03:27 +03:00
h8300
hexagon smp: Add task_struct argument to __cpu_up() 2016-10-29 23:12:38 +08:00
ia64 smp: Add task_struct argument to __cpu_up() 2016-10-29 23:12:38 +08:00
m32r smp: Add task_struct argument to __cpu_up() 2016-10-29 23:12:38 +08:00
m68k
microblaze seccomp: ignore secure_computing return values 2014-10-31 19:46:19 -07:00
mips mm: larger stack guard gap, between vmas 2017-07-02 13:03:27 +03:00
mn10300 smp: Add task_struct argument to __cpu_up() 2016-10-29 23:12:38 +08:00
openrisc
parisc smp: Add task_struct argument to __cpu_up() 2016-10-29 23:12:38 +08:00
powerpc mm: larger stack guard gap, between vmas 2017-07-02 13:03:27 +03:00
s390 smp: Add task_struct argument to __cpu_up() 2016-10-29 23:12:38 +08:00
score
sh mm: larger stack guard gap, between vmas 2017-07-02 13:03:27 +03:00
sparc mm: larger stack guard gap, between vmas 2017-07-02 13:03:27 +03:00
tile mm: larger stack guard gap, between vmas 2017-07-02 13:03:27 +03:00
um smp: Add task_struct argument to __cpu_up() 2016-10-29 23:12:38 +08:00
unicore32
x86 mm: Tighten x86 /dev/mem with zeroing reads 2017-07-04 12:34:19 +03:00
xtensa
.gitignore
Kconfig FROMLIST: mm: mmap: Add new /proc tunable for mmap_base ASLR. 2016-10-29 23:12:40 +08:00