lkdtm: hide stack overflow warning for corrupt-stack test
After the latest change to make sure the compiler actually does a memset,
it is now smart enough to flag the stack overflow at compile time,
at least with gcc-7.0:
drivers/misc/lkdtm_bugs.c: In function 'lkdtm_CORRUPT_STACK':
drivers/misc/lkdtm_bugs.c:88:144: warning: 'memset' writing 64 bytes into a region of size 8 overflows the destination [-Wstringop-overflow=]
To outsmart the compiler again, this moves the memset into a noinline
function where (for now) it doesn't see that we intentionally write
broken code here.
Change-Id: I66f033e4e2be2932f1ad8d6f4097bb03c501dbf1
Fixes: c55d240003ae ("lkdtm: Prevent the compiler from optimising lkdtm_CORRUPT_STACK()")
Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
Acked-by:
Kees Cook <keescook@chromium.org>
Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 7a11a1d1b58873b2e5a6922dcdc23b6b339b14ba
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by:
Olav Haugan <ohaugan@codeaurora.org>
Loading
Please register or sign in to comment