Commit b9bc7b8b authored by Raul E Rangel's avatar Raul E Rangel Committed by Greg Kroah-Hartman

lkdtm/bugs: fix build error in lkdtm_EXHAUST_STACK

lkdtm/bugs.c:94:2: error: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Werror=format=]
  pr_info("Calling function with %d frame size to depth %d ...\n",
  ^
THREAD_SIZE is defined as a unsigned long, cast CONFIG_FRAME_WARN to
unsigned long as well.

Fixes: 24cccab4 ("lkdtm/bugs: Adjust recursion test to avoid elision")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarRaul E Rangel <rrangel@chromium.org>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20190827173619.170065-1-rrangel@chromium.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 587f1740
...@@ -22,7 +22,7 @@ struct lkdtm_list { ...@@ -22,7 +22,7 @@ struct lkdtm_list {
* recurse past the end of THREAD_SIZE by default. * recurse past the end of THREAD_SIZE by default.
*/ */
#if defined(CONFIG_FRAME_WARN) && (CONFIG_FRAME_WARN > 0) #if defined(CONFIG_FRAME_WARN) && (CONFIG_FRAME_WARN > 0)
#define REC_STACK_SIZE (CONFIG_FRAME_WARN / 2) #define REC_STACK_SIZE (_AC(CONFIG_FRAME_WARN, UL) / 2)
#else #else
#define REC_STACK_SIZE (THREAD_SIZE / 8) #define REC_STACK_SIZE (THREAD_SIZE / 8)
#endif #endif
...@@ -91,7 +91,7 @@ void lkdtm_LOOP(void) ...@@ -91,7 +91,7 @@ void lkdtm_LOOP(void)
void lkdtm_EXHAUST_STACK(void) void lkdtm_EXHAUST_STACK(void)
{ {
pr_info("Calling function with %d frame size to depth %d ...\n", pr_info("Calling function with %lu frame size to depth %d ...\n",
REC_STACK_SIZE, recur_count); REC_STACK_SIZE, recur_count);
recursive_loop(recur_count); recursive_loop(recur_count);
pr_info("FAIL: survived without exhausting stack?!\n"); pr_info("FAIL: survived without exhausting stack?!\n");
......
Markdown is supported
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