All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	linux-hardening@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hardening: Refresh KCFI options, add some more
Date: Tue, 30 Apr 2024 14:15:53 -0700	[thread overview]
Message-ID: <202404301409.D3BC98D5@keescook> (raw)
In-Reply-To: <202404301037.9E34D4811@keescook>

On Tue, Apr 30, 2024 at 10:48:36AM -0700, Kees Cook wrote:
> On Tue, Apr 30, 2024 at 11:21:40AM +0200, Peter Zijlstra wrote:
> > On Fri, Apr 26, 2024 at 03:29:44PM -0700, Kees Cook wrote:
> > 
> > > - CONFIG_CFI_CLANG=y for x86 and arm64. (And disable FINEIBT since
> > >   it isn't as secure as straight KCFI.)
> > 
> > Oi ?
> 
> Same objection I always had[1]: moving the check into the destination
> means attacks with control over executable memory contents can just omit
> the check.
> 
> But now that I went to go look I see 0c3e806ec0f9 ("x86/cfi: Add boot
> time hash randomization") is only enabled under FINEIBT... seems better
> if that were always enabled...

And FINEIBT actually can't be disabled... :|

And as it turns out CFI_CLANG doesn't work at all on v6.9...

[    0.587220] no CFI hash found at: __call_sites+0x339a8/0x34450 ffffffffac20cef8 00 00 00 00 00
[    0.588226] WARNING: CPU: 0 PID: 0 at arch/x86/kernel/alternative.c:1182 __apply_fineibt+0x7a9/0x820
...
[    0.619220] SMP alternatives: Something went horribly wrong trying to rewrite the CFI implementation.
*hang*



-- 
Kees Cook

WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	linux-hardening@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hardening: Refresh KCFI options, add some more
Date: Tue, 30 Apr 2024 14:15:53 -0700	[thread overview]
Message-ID: <202404301409.D3BC98D5@keescook> (raw)
In-Reply-To: <202404301037.9E34D4811@keescook>

On Tue, Apr 30, 2024 at 10:48:36AM -0700, Kees Cook wrote:
> On Tue, Apr 30, 2024 at 11:21:40AM +0200, Peter Zijlstra wrote:
> > On Fri, Apr 26, 2024 at 03:29:44PM -0700, Kees Cook wrote:
> > 
> > > - CONFIG_CFI_CLANG=y for x86 and arm64. (And disable FINEIBT since
> > >   it isn't as secure as straight KCFI.)
> > 
> > Oi ?
> 
> Same objection I always had[1]: moving the check into the destination
> means attacks with control over executable memory contents can just omit
> the check.
> 
> But now that I went to go look I see 0c3e806ec0f9 ("x86/cfi: Add boot
> time hash randomization") is only enabled under FINEIBT... seems better
> if that were always enabled...

And FINEIBT actually can't be disabled... :|

And as it turns out CFI_CLANG doesn't work at all on v6.9...

[    0.587220] no CFI hash found at: __call_sites+0x339a8/0x34450 ffffffffac20cef8 00 00 00 00 00
[    0.588226] WARNING: CPU: 0 PID: 0 at arch/x86/kernel/alternative.c:1182 __apply_fineibt+0x7a9/0x820
...
[    0.619220] SMP alternatives: Something went horribly wrong trying to rewrite the CFI implementation.
*hang*



-- 
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-04-30 21:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 22:29 [PATCH] hardening: Refresh KCFI options, add some more Kees Cook
2024-04-26 22:29 ` Kees Cook
2024-04-29 22:16 ` Nathan Chancellor
2024-04-29 22:16   ` Nathan Chancellor
2024-04-30  5:35   ` Kees Cook
2024-04-30  5:35     ` Kees Cook
2024-04-30 15:12     ` Nathan Chancellor
2024-04-30 15:12       ` Nathan Chancellor
2024-04-30  9:21 ` Peter Zijlstra
2024-04-30  9:21   ` Peter Zijlstra
2024-04-30 17:48   ` Kees Cook
2024-04-30 17:48     ` Kees Cook
2024-04-30 21:15     ` Kees Cook [this message]
2024-04-30 21:15       ` Kees Cook
2024-04-30 21:25       ` Kees Cook
2024-04-30 21:25         ` Kees Cook
2024-05-01 11:06     ` Peter Zijlstra
2024-05-01 11:06       ` Peter Zijlstra
2024-05-01 19:27       ` Kees Cook
2024-05-01 19:27         ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202404301409.D3BC98D5@keescook \
    --to=keescook@chromium.org \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=gustavoars@kernel.org \
    --cc=hpa@zytor.com \
    --cc=justinstitt@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mingo@redhat.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.