]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/configs/skiroot: Enable some more hardening options
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 21 Jan 2020 04:29:59 +0000 (15:29 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 31 Jan 2020 10:20:35 +0000 (21:20 +1100)
commitefba712f2df2b4a851016f3096ab1d0d8590d06b
tree78c05b89a6aaa7ffc17a53746d0fcffeb3248401
parentbc43da388ec4ae882304ef0bad4629b637c69c63
powerpc/configs/skiroot: Enable some more hardening options

Enable more hardening options.

Note BUG_ON_DATA_CORRUPTION selects DEBUG_LIST and is essentially just
a synonym for it.

DEBUG_SG, DEBUG_NOTIFIERS, DEBUG_LIST, DEBUG_CREDENTIALS and
SCHED_STACK_END_CHECK should all be low overhead and just add a few
extra checks.

SLAB_FREELIST_RANDOM, and SLUB_DEBUG_ON will add some overhead to the
SLAB allocator, but nothing that should be meaningful for skiroot.

Unselecting SLAB_MERGE_DEFAULT causes the SLAB to use more memory, but
the skiroot kernel shouldn't be memory constrained on any of our
systems, all it does is run a small bootloader.

Disabling merging has some security/robustness benefit as it means a
user-after-free or overflow will be limited to the objects in that
slab, rather than potentially affecting objects from unrelated slabs
that have been merged.

Note also that slab merging is disabled anyway by enabling
SLUB_DEBUG_ON, because of the SLAB_NEVER_MERGE mask.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20200121043000.16212-9-mpe@ellerman.id.au
arch/powerpc/configs/skiroot_defconfig