Skip to content
Commit 8c30d32b authored by Kees Cook's avatar Kees Cook
Browse files

lib/test_stackinit: Handle Clang auto-initialization pattern



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>
parent f2c7c76c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment