Skip to content

[PW_SID:959200] stackleak: Support Clang stack depth tracking#368

Closed
linux-riscv-bot wants to merge 5 commits into
workflow__riscv__fixesfrom
pw959200
Closed

[PW_SID:959200] stackleak: Support Clang stack depth tracking#368
linux-riscv-bot wants to merge 5 commits into
workflow__riscv__fixesfrom
pw959200

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 959200 applied to workflow__riscv__fixes

Name: stackleak: Support Clang stack depth tracking
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=959200
Version: 1

Linux RISC-V bot and others added 5 commits April 30, 2025 11:41
In preparation for adding Clang sanitizer coverage stack depth
tracking that can support stack depth callbacks, remove "GCC_PLUGIN"
from "CONFIG_GCC_PLUGIN_STACKLEAK" and remove "PLUGIN" from
"DISABLE_STACKLEAK_PLUGIN". Rearrange the Kconfig to have a top-level
CONFIG_STACKLEAK that will depend on either GCC plugins or Clang soon.

While here, also split "prev_lowest_stack" into CONFIG_STACKLEAK_METRICS,
since that's the only place it is referenced from.

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The Clang stack depth tracking implementation has a fixed name for the
stack depth tracking callback, "__sanitizer_cov_stack_depth", so rename
the GCC plugin function to match.

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
In preparation for Clang stack depth tracking for stackleak, split the
stackleak-specific cflags out of GCC_PLUGINS_CFLAGS into
STACKLEAK_CFLAGS.

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Wire up stackleak to Clang's proposed[1] stack depth tracking callback
option. While __noinstr already contained __no_sanitize_coverage, it was
still needed for __init and __head section markings. This is needed to
make sure the callback is not executed in unsupported contexts.

Link: llvm/llvm-project#138323 [1]
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 104.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1943.64 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2444.13 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 19.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.42 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 4.60 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 67.99 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
kdoc
Desc: Detects for kdoc errors
Duration: 0.95 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
module-param
Desc: Detect module_param changes
Duration: 0.34 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RFC,1/4] stackleak: Rename CONFIG_GCC_PLUGIN_STACKLEAK to CONFIG_STACKLEAK"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 104.39 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 991.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1285.35 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 19.83 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.64 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 66.53 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
kdoc
Desc: Detects for kdoc errors
Duration: 1.04 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[RFC,2/4] stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 105.64 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 883.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1142.59 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.39 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.41 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 67.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
kdoc
Desc: Detects for kdoc errors
Duration: 0.76 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
module-param
Desc: Detect module_param changes
Duration: 2.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.52 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[RFC,3/4] stackleak: Split STACKLEAK_CFLAGS from GCC_PLUGINS_CFLAGS"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 105.72 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1955.43 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2457.74 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.37 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.47 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 3.02 seconds
Result: ERROR
Output:

ERROR: Macros with complex values should be enclosed in parentheses
#30: FILE: arch/x86/include/asm/init.h:8:
+#define __head	__section(".head.text") __no_sanitize_undefined __no_sanitize_coverage

ERROR: Macros with complex values should be enclosed in parentheses
#43: FILE: include/linux/init.h:52:
+#define __init		__section(".init.text") __cold __latent_entropy	\
+						__noinitretpoline	\
+						__no_sanitize_coverage

total: 2 errors, 0 warnings, 0 checks, 47 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 8e52ec91c616 ("stackleak: Support Clang stack depth tracking") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
ERROR: Macros with complex values should be enclosed in parentheses


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 67.65 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[RFC,4/4] stackleak: Support Clang stack depth tracking"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow__riscv__fixes branch from 4d9ad71 to 625be03 Compare May 6, 2025 09:20
@linux-riscv-bot linux-riscv-bot deleted the pw959200 branch May 7, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants