Re: [PATCH v2 02/11] kconfig-audit: Introduce a PREEMPT_RT configuration policy

From: sashiko-bot

Date: Fri Dec 04 2026 - 17:50:17 EST


Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [Low] kconfig-audit: dead docs_hint anchor for CONFIG_RCU_NOCB_CPU
- [Low] kconfig-audit: SPDX-License-Identifier placed on line 3 instead
of line 1
- [Low] kconfig-audit: unanchored CONFIG_NO_HZ regex in preempt_rt.yml
over-matches
- [Low] kconfig-audit: preempt_rt policy flags CONFIG_SLUB_DEBUG at high
severity
- [Low] kconfig-audit: preempt_rt requires CONFIG_EFI_DISABLE_RUNTIME
without EFI
- [Low] kconfig-audit: preempt_rt flags DEBUG_ALIGN_RODATA and
DEBUG_MEMORY_INIT
--

commit 7aa69801eececedf40a26be60e739042d6c45696
Author: Ahmed S. Darwish <darwi@xxxxxxxxxxxxx>

kconfig-audit: Introduce a PREEMPT_RT configuration policy

This commit adds a kconfig-audit policy file defining expected kernel
configuration options for PREEMPT_RT kernels, intended to stay aligned
with Documentation/core-api/real-time/kernel-configuration.rst.

> diff --git a/tools/kconfig-audit/policy/preempt_rt.yml b/tools/kconfig-audit/policy/preempt_rt.yml
> new file mode 100644
> index 0000000000000..a9972e3c34534
> --- /dev/null
> +++ b/tools/kconfig-audit/policy/preempt_rt.yml
> @@ -0,0 +1,179 @@
> +# PREEMPT_RT .config sanitization
> +#
> +# SPDX-License-Identifier: GPL-2.0-only

[Severity: Low]
Should SPDX-License-Identifier be on the first line of the file?

Documentation/process/license-rules.rst requires the SPDX tag on the first
comment line for non-shebang files, which checkpatch.pl and license checks
expect.

[ ... ]

> + - name: CONFIG_EFI_DISABLE_RUNTIME
> + expected: enabled
> + severity: medium
> + docs_hint: config

[Severity: Low]
Will requiring CONFIG_EFI_DISABLE_RUNTIME to be enabled cause false
positives on non-EFI builds?

CONFIG_EFI_DISABLE_RUNTIME depends on CONFIG_EFI in
drivers/firmware/efi/Kconfig, so it is absent from .config on non-EFI
targets. Because audit.py flags missing symbols when expected is enabled,
non-EFI builds fail the audit even though EFI runtime services are gone.

> +
> + - name_pattern: CONFIG_NO_HZ(_FULL|_IDLE)?
> + expected: disabled
> + severity: medium
> + docs_hint: config-no-hz-config-no-hz-full

[Severity: Low]
Should this pattern be anchored as ^CONFIG_NO_HZ(_FULL|_IDLE)?$?

KernelConfig.get_matching_symbols() uses unanchored re.search(), so the
optional (_FULL|_IDLE)? suffix matches the empty string and the rule also
matches the hidden CONFIG_NO_HZ_COMMON symbol. If a PolicyOverlay exempts
CONFIG_NO_HZ_FULL, CONFIG_NO_HZ_COMMON=y still fails the audit.

Similarly, the unanchored CONFIG_DEBUG pattern below has no trailing
underscore and also matches the hidden PowerPC CONFIG_DEBUGGER symbol.

[ ... ]

> + - name: CONFIG_RCU_NOCB_CPU
> + expected: enabled
> + severity: low
> + docs_hint: config

[Severity: Low]
Does docs_hint: config resolve to a dead link for CONFIG_RCU_NOCB_CPU?

With docs_url pointing to kernel-configuration.html, this generates
#config-rcu-nocb-cpu, but
Documentation/core-api/real-time/kernel-configuration.rst has no section
for CONFIG_RCU_NOCB_CPU.

Because CONFIG_RCU_NOCB_CPU defaults to n and depends on CONFIG_RCU_EXPERT
when CONFIG_NO_HZ_FULL is disabled, most configs will trigger this rule
with no working documentation link or inline rationale.

[ ... ]

> + - name_pattern: CONFIG_DEBUG
> + expected: disabled
> + severity: medium
> + docs_hint: kernel-debug-options

[Severity: Low]
Should CONFIG_DEBUG_ALIGN_RODATA and CONFIG_DEBUG_MEMORY_INIT have neutral
exemptions under this catch-all rule?

CONFIG_DEBUG_ALIGN_RODATA defaults to y on ARMv7 with STRICT_KERNEL_RWX
and only aligns .rodata in arch/arm/kernel/vmlinux.lds.S for NX hardening,
with zero runtime overhead. Flagging it advises disabling a link-time
security feature on default ARMv7 PREEMPT_RT configs.

CONFIG_DEBUG_MEMORY_INIT is also preserved when enabling EXPERT and
PREEMPT_RT on top of standard defconfigs, and only compiles __init and
__meminit checks with no normal runtime RT latency impact.

[ ... ]

> + - name_pattern: CONFIG_SLUB_DEBUG.*
> + expected: disabled
> + severity: high
> + docs_hint: kernel-debug-options

[Severity: Low]
Should this high-severity rule target CONFIG_SLUB_DEBUG_ON rather than
matching CONFIG_SLUB_DEBUG as well?

CONFIG_SLUB_DEBUG defaults to y and is needed for /proc/slabinfo, while
runtime SLUB debug checks remain patched out behind slub_debug_enabled
unless CONFIG_SLUB_DEBUG_ON is set. Flagging CONFIG_SLUB_DEBUG.* at high
severity fails standard PREEMPT_RT configs that keep SLUB debugging off.

--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203224916.118064-1-darwi@xxxxxxxxxxxxx?part=2