Patch "drivers: lkdtm: fix clang -Wformat warning" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drivers: lkdtm: fix clang -Wformat warning

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drivers-lkdtm-fix-clang-wformat-warning.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 28e8aff820ffac615cd55dd0d17ec87ec51a2536
Author: Justin Stitt <justinstitt@xxxxxxxxxx>
Date:   Thu Jul 21 14:57:06 2022 -0700

    drivers: lkdtm: fix clang -Wformat warning
    
    [ Upstream commit b4909252da9be56fe1e0a23c2c1908c5630525fa ]
    
    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@xxxxxxxxxx>
    Suggested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Suggested-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
    Signed-off-by: Justin Stitt <justinstitt@xxxxxxxxxx>
    Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Acked-by: Kees Cook <keescook@xxxxxxxxxxxx>
    Fixes: 24cccab42c419 ("lkdtm/bugs: Adjust recursion test to avoid elision")
    Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220721215706.4153027-1-justinstitt@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c
index fac4a811b97b..3ab8dbae96af 100644
--- a/drivers/misc/lkdtm/bugs.c
+++ b/drivers/misc/lkdtm/bugs.c
@@ -29,7 +29,7 @@ struct lkdtm_list {
 #if defined(CONFIG_FRAME_WARN) && (CONFIG_FRAME_WARN > 0)
 #define REC_STACK_SIZE (_AC(CONFIG_FRAME_WARN, UL) / 2)
 #else
-#define REC_STACK_SIZE (THREAD_SIZE / 8)
+#define REC_STACK_SIZE (THREAD_SIZE / 8UL)
 #endif
 #define REC_NUM_DEFAULT ((THREAD_SIZE / REC_STACK_SIZE) * 2)
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux