From: Kees Cook <kees@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
llvm@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH 3/3] objtool: Skip jump table jumps in the kCFI indirect call check
Date: Tue, 13 Oct 2026 01:37:03 -0700 [thread overview]
Message-ID: <202610130126.E24D003C0@keescook> (raw)
In-Reply-To: <20261013064405.GY2009045@noisy.programming.kicks-ass.net>
On Tue, Oct 13, 2026 at 08:44:05AM +0200, Peter Zijlstra wrote:
> On Mon, Oct 12, 2026 at 11:41:03AM -0700, Kees Cook wrote:
> > Clang never has this jump: with retpolines, LLVM's IndirectBrExpand pass
> > turns the label addresses into indexes and the "goto *" into a switch,
> > which Clang's -fno-jump-tables then makes a compare tree. So it's only
> > constructed this way under GCC, but since now we can turn on kCFI with
> > GCC, the objtool warning about indirects without kcfi protection trips.
>
> OK, then the next question; do we *want* to allow a 'naked' indirect
> branch to survive?
I originally struggled about this. I'd really rather that GCC not codgen
like this at all. On the other hand, it's a bounded load and jump through
an .rodata table, so that's kind of a manual CFI. :P (And if it gets
targeted via ROP, it doesn't matter: everything is a target then.)
> We can simply disable the whole interpreter when kcfi=y. Isn't that
> thing recommended disabled anyway?
I don't think that's realistic, as every GCC-building distro will (I
hope) enable KCFI as soon as it's in GCC. It's present with
CONFIG_BPF_JIT_ALWAYS_ON=y, and only Debian has it off:
│ Debian sid and trixie │ not set
│ Ubuntu noble │ y
│ Fedora, CentOS Stream 9 and 10 │ y
│ Arch │ y
│ openSUSE Tumbleweed, SLE15-SP7 │ y
│ Alpine (lts and virt) │ y
│ Android GKI android16-6.12 (arm64 and x86) │ y
--
Kees Cook
next prev parent reply other threads:[~2026-10-13 8:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 9:04 [PATCH 0/3] x86/cfi: Fix a few kCFI issues found with GCC Kees Cook
2026-10-12 9:04 ` [PATCH 1/3] x86/kcfi: Decode the kCFI check from the trap address Kees Cook
2026-10-12 9:04 ` [PATCH 2/3] x86/kcfi: Emit the FineIBT paranoid "cs" prefix as a byte Kees Cook
2026-10-12 9:16 ` Peter Zijlstra
2026-10-12 19:05 ` Andrew Cooper
2026-10-13 8:07 ` Kees Cook
2026-10-12 9:04 ` [PATCH 3/3] objtool: Skip jump table jumps in the kCFI indirect call check Kees Cook
2026-10-12 9:22 ` Peter Zijlstra
2026-10-12 18:41 ` Kees Cook
2026-10-13 6:44 ` Peter Zijlstra
2026-10-13 8:37 ` Kees Cook [this message]
2026-10-13 9:06 ` Peter Zijlstra
2026-10-13 9:11 ` Peter Zijlstra
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=202610130126.E24D003C0@keescook \
--to=kees@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=justinstitt@google.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=samitolvanen@google.com \
/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.