I’m going to talk primarily about what went into the kernel
A lot of kernel security features originated outside of the upstream kernel in projects like grsecurity, but my focus will be on upstream mainline Linux
We’re talking about the kernel protecting itself against attacks, rather than security features the kernel exposes to userspace
specifically, kernel hardening / kernel self protection
Idx Name Size VMA LMA File off Algn
0 .head.text 00008000 c000000000000000 0000000000000000 00010000 2**7
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .text 02794574 c000000000008000 0000000000008000 00018000 2**8
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .rodata 00e4b446 c0000000027a0000 00000000027a0000 027b0000 2**8
CONTENTS, ALLOC, LOAD, DATA
“Mark the kernel read-only data as write-protected in the pagetables, in order to catch accidental (and incorrect) writes to such const data.” - Arjan van de Ven
/* * Ok, we have completed the initial bootup, and * we're essentially up and running. Get rid of the * initmem segments and start the user-mode stuff.. */ free_initmem(); unlock_kernel(); mark_rodata_ro(); system_state = SYSTEM_RUNNING;
.text) should be R-X.data) should be RW-.rodata) should be R--
compiler feature, now used for the kernel itself
canary inserted into the stack
kernel panic if canary changes
return address can’t be modified without defeating the canary
RWX permissions everywhereDEBUG_RODATA for modulesR-X, data RW-, rodata R--HARDENED_MODULE_MAPPINGS before finally becoming STRICT_MODULE_RWX
PXN, KUEP and othersyeah they’re sane now
copy_to_user() and copy_from_user()copy_to/from_user() and disabled after
commit affddff69c55eb68969448f35f59054a370bc7c1
Author: Russell Currey <ruscur@russell.cc>
Date: Fri Nov 27 17:23:07 2015 +1100
powerpc/powernv: Add a kmsg_dumper that flushes console output on panic
The buggy address belongs to the object at ffff8801f44ec300 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 123 bytes inside of 128-byte region [ffff8801f44ec300, ffff8801f44ec380) The buggy address belongs to the page: page:ffffea0007d13b00 count:1 mapcount:0 mapping:ffff8801f7001640 index:0x0 flags: 0x200000000000100(slab) raw: 0200000000000100 ffffea0007d11dc0 0000001a0000001a ffff8801f7001640 raw: 0000000000000000 0000000080150015 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected
i hope i didn’t miss anythin g
@ruscur@ozlabs.house@ruscur:ozlabs.house