• Michael Ellerman's avatar
    powerpc/configs/skiroot: Enable some more hardening options · 5e84dd54
    Michael Ellerman authored
    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: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Acked-by: default avatarJoel Stanley <joel@jms.id.au>
    Link: https://lore.kernel.org/r/20200121043000.16212-9-mpe@ellerman.id.au
    5e84dd54
skiroot_defconfig 7.96 KB