diff options
author | Kees Cook <kees@kernel.org> | 2025-06-28 16:40:38 -0700 |
---|---|---|
committer | Kees Cook <kees@kernel.org> | 2025-07-14 22:43:52 -0700 |
commit | 10299c07c94aa0997fa43523b53301e713a6415d (patch) | |
tree | c24b8562aee584577c128f59c2aa37f0114c40c9 /include/linux/string.h | |
parent | 5e54510a9389caa922360218a83a58cd30fec686 (diff) |
kunit/fortify: Add back "volatile" for sizeof() constants
It seems the Clang can see through OPTIMIZER_HIDE_VAR when the constant
is coming from sizeof. Adding "volatile" back to these variables solves
this false positive without reintroducing the issues that originally led
to switching to OPTIMIZER_HIDE_VAR in the first place[1].
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://github.com/ClangBuiltLinux/linux/issues/2075 [1]
Cc: Jannik Glückert <jannik.glueckert@gmail.com>
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Fixes: 6ee149f61bcc ("kunit/fortify: Replace "volatile" with OPTIMIZER_HIDE_VAR()")
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20250628234034.work.800-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'include/linux/string.h')
0 files changed, 0 insertions, 0 deletions