lkdtm/bugs: Adjust recursion test to avoid elision
authorKees Cook <keescook@chromium.org>
Sat, 6 Apr 2019 15:59:19 +0000 (08:59 -0700)
committerKees Cook <keescook@chromium.org>
Sun, 7 Apr 2019 17:38:31 +0000 (10:38 -0700)
commit24cccab42c4199c6daa0a6981e6f6a1ffb0b5a09
treed99b4d6dc3bf6bf86d252b5649508f68fa81de07
parent2bf8496f6e9b7e9a557f65eb95eab16fea7958c7
lkdtm/bugs: Adjust recursion test to avoid elision

While I was able to trick gcc into keeping a pathological recursion,
Clang was not so easily fooled. Instead, switch to using "volatile" and
side-effects to keep the stack variable allocated and to run the function.
Additionally renames "OVERFLOW" to "EXHAUST_STACK" to better describe the
test.

Signed-off-by: Kees Cook <keescook@chromium.org>
drivers/misc/lkdtm/bugs.c
drivers/misc/lkdtm/core.c
drivers/misc/lkdtm/lkdtm.h