[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250904184004.GC2110053@ax162>
Date: Thu, 4 Sep 2025 11:40:04 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Kees Cook <kees@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Vegard Nossum <vegard.nossum@...cle.com>,
Miguel Ojeda <ojeda@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Jeff Johnson <jeff.johnson@....qualcomm.com>,
Randy Dunlap <rdunlap@...radead.org>,
David Woodhouse <dwmw2@...radead.org>,
"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>,
Marco Elver <elver@...gle.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>,
Ramon de C Valle <rcvalle@...gle.com>,
Jonathan Corbet <corbet@....net>,
"Paul E. McKenney" <paulmck@...nel.org>,
Nicolas Schier <nicolas.schier@...ux.dev>,
Masahiro Yamada <masahiroy@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Sami Tolvanen <samitolvanen@...gle.com>,
Mark Rutland <mark.rutland@....com>, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, linux-doc@...r.kernel.org,
linux-kbuild@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
x86@...nel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2 4/9] x86/cfi: Standardize on common "CFI:" prefix for
CFI reports
On Wed, Sep 03, 2025 at 08:46:43PM -0700, Kees Cook wrote:
> Use a regular "CFI:" prefix for CFI reports during alternatives setup,
> including reporting when nothing has happened (i.e. CONFIG_FINEIBT=n).
>
> Signed-off-by: Kees Cook <kees@...nel.org>
> ---
Reviewed-by: Nathan Chancellor <nathan@...nel.org>
Obviously minor but I had pointed out on v1 that there appears to be
some inconsistency within the diff around capitalization, "ignoring" vs.
"Ignoring".
> ---
> arch/x86/kernel/alternative.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 7bde68247b5f..d8f4ac95b4df 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -1266,26 +1266,26 @@ static __init int cfi_parse_cmdline(char *str)
> } else if (!strcmp(str, "norand")) {
> cfi_rand = false;
> } else if (!strcmp(str, "warn")) {
> - pr_alert("CFI mismatch non-fatal!\n");
> + pr_alert("CFI: mismatch non-fatal!\n");
> cfi_warn = true;
> } else if (!strcmp(str, "paranoid")) {
> if (cfi_mode == CFI_FINEIBT) {
> cfi_paranoid = true;
> } else {
> - pr_err("Ignoring paranoid; depends on fineibt.\n");
> + pr_err("CFI: ignoring paranoid; depends on fineibt.\n");
> }
> } else if (!strcmp(str, "bhi")) {
> #ifdef CONFIG_FINEIBT_BHI
> if (cfi_mode == CFI_FINEIBT) {
> cfi_bhi = true;
> } else {
> - pr_err("Ignoring bhi; depends on fineibt.\n");
> + pr_err("CFI: ignoring bhi; depends on fineibt.\n");
> }
> #else
> - pr_err("Ignoring bhi; depends on FINEIBT_BHI=y.\n");
> + pr_err("CFI: ignoring bhi; depends on FINEIBT_BHI=y.\n");
> #endif
> } else {
> - pr_err("Ignoring unknown cfi option (%s).", str);
> + pr_err("CFI: Ignoring unknown option (%s).", str);
> }
>
> str = next;
> @@ -1757,7 +1757,7 @@ static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
> switch (cfi_mode) {
> case CFI_OFF:
> if (builtin)
> - pr_info("Disabling CFI\n");
> + pr_info("CFI: disabled\n");
> return;
>
> case CFI_KCFI:
> @@ -1766,7 +1766,8 @@ static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
> goto err;
>
> if (builtin)
> - pr_info("Using kCFI\n");
> + pr_info("CFI: Using %sretpoline kCFI\n",
> + cfi_rand ? "rehashed " : "");
> return;
>
> case CFI_FINEIBT:
> @@ -2005,6 +2006,8 @@ bool decode_fineibt_insn(struct pt_regs *regs, unsigned long *target, u32 *type)
> static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
> s32 *start_cfi, s32 *end_cfi, bool builtin)
> {
> + if (IS_ENABLED(CONFIG_CFI) && builtin)
> + pr_info("CFI: Using standard kCFI\n");
> }
>
> #ifdef CONFIG_X86_KERNEL_IBT
> --
> 2.34.1
>
Powered by blists - more mailing lists