• Kees Cook's avatar
    lib/test_stackinit: Handle Clang auto-initialization pattern · 8c30d32b
    Kees Cook authored
    While the gcc plugin for automatic stack variable initialization (i.e.
    CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) performs initialization with
    0x00 bytes, the Clang automatic stack variable initialization (i.e.
    CONFIG_INIT_STACK_ALL) uses various type-specific patterns that are
    typically 0xAA. Therefore the stackinit selftest has been fixed to check
    that bytes are no longer the test fill pattern of 0xFF (instead of looking
    for bytes that have become 0x00). This retains the test coverage for the
    0x00 pattern of the gcc plugin while adding coverage for the mostly 0xAA
    pattern of Clang.
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    8c30d32b
test_stackinit.c 10.9 KB