linux/drivers/misc/lkdtm
Justin Stitt b4909252da drivers: lkdtm: fix clang -Wformat warning
When building with Clang we encounter the following warning
(ARCH=hexagon + CONFIG_FRAME_WARN=0):
| ../drivers/misc/lkdtm/bugs.c:107:3: error: format specifies type
| 'unsigned long' but the argument has type 'int' [-Werror,-Wformat]
|                 REC_STACK_SIZE, recur_count);
|                 ^~~~~~~~~~~~~~

Cast REC_STACK_SIZE to `unsigned long` to match format specifier `%lu`
as well as maintain symmetry with `#define REC_STACK_SIZE
(_AC(CONFIG_FRAME_WARN, UL) / 2)`.

Link: https://github.com/ClangBuiltLinux/linux/issues/378
Reported-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Fixes: 24cccab42c ("lkdtm/bugs: Adjust recursion test to avoid elision")
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220721215706.4153027-1-justinstitt@google.com
2022-07-27 12:16:17 -07:00
..
bugs.c drivers: lkdtm: fix clang -Wformat warning 2022-07-27 12:16:17 -07:00
cfi.c lkdtm: cfi: Fix type width for masking PAC bits 2022-04-26 17:11:05 -07:00
core.c lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
fortify.c lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
heap.c lkdtm/heap: Hide allocation size from -Warray-bounds 2022-05-17 14:47:08 -07:00
lkdtm.h lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
Makefile Char/Misc and other driver changes for 5.17-rc1 2022-01-14 16:02:28 +01:00
perms.c lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
powerpc.c lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
refcount.c lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
rodata.c lkdtm: don't move ctors to .rodata 2020-12-09 15:51:14 +01:00
stackleak.c Char / Misc / Other smaller driver subsystem updates for 5.19-rc1 2022-06-03 11:36:34 -07:00
usercopy.c lkdtm/usercopy: Check vmalloc and >0-order folios 2022-05-17 14:35:49 -07:00