From: Karl Mehltretter <kmehltretter@gmail.com>
To: Kees Cook <kees@kernel.org>
Cc: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
"Linus Walleij" <linusw@kernel.org>,
"Nathan Chancellor" <nathan@kernel.org>,
"Sami Tolvanen" <samitolvanen@google.com>,
"Zhen Lei" <thunder.leizhen@huawei.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Michał Pecio" <michal.pecio@gmail.com>,
"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
linux-arm-kernel@lists.infradead.org,
"Russell King" <linux@armlinux.org.uk>,
"Will Deacon" <will@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Nick Desaulniers" <ndesaulniers@google.com>,
"Bill Wendling" <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3] ARM: traps: Implement KCFI trap handler for ARM32
Date: Mon, 27 Jul 2026 03:28:09 +0200 [thread overview]
Message-ID: <amazbT2M9PQgb_Vq@gmail.com> (raw)
In-Reply-To: <20260715175223.make.153-kees@kernel.org>
On Wed, Jul 15, 2026 at 10:52:27AM +0100, Kees Cook wrote:
> +/* UDF base pattern with KCFI bit: cond=0xe, 0x7f, xxxx, 1xxx, 0xf, xxxx */
> +#define CFI_UDF_IMM_BASE 0xe7f008f0
> +#define CFI_UDF_IMM_MASK 0xfff008f0 /* Mask for UDF + KCFI bit matching */
With this patch applied, KGDB and CONFIG_CFI cannot be used together.
Setting a breakpoint causes Oops as CFI failure.
This patch on top of "ARM: breakpoint: CFI breakpoints only on demand",
multi_v7_defconfig + CONFIG_CFI=y + KGDB/KGDB_KDB/MAGIC_SYSRQ, THUMB2_KERNEL=n,
clang 22.1.8 LLVM=1, qemu-system-arm -M virt -cpu cortex-a15, booted with
kgdboc=ttyAMA0.
Then "echo g > /proc/sysrq-trigger":
sysrq: DEBUG
CFI failure at kgdb_breakpoint+0x2c/0x58 (target: kgdb_breakpoint+0x2c/0x58; expected type: 0xc0472d70)
Internal error: Oops - CFI: 0 [#1] SMP ARM
Modules linked in:
CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 7.2.0-rc3-00278-g38436106b2f5-dirty #1 VOLUNTARY
Hardware name: Generic DT based system
PC is at kgdb_breakpoint+0x2c/0x58
LR is at kgdb_breakpoint+0x2c/0x58
pc : [<c0472d70>] lr : [<c0472d70>] psr: 60000013
sp : e080dea8 ip : 00000000 fp : 0021a1c0
r10: 00000000 r9 : 00000000 r8 : c2004048
r7 : c2205d9c r6 : 00000000 r5 : c1609558 r4 : c22bb994
r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : 00000000
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
...
kgdb_breakpoint from __handle_sysrq+0x150/0x158
Thanks,
Karl
next prev parent reply other threads:[~2026-07-27 1:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 17:52 [PATCH v3] ARM: traps: Implement KCFI trap handler for ARM32 Kees Cook
2026-07-21 0:11 ` Nathan Chancellor
2026-07-21 7:54 ` Linus Walleij
2026-07-21 16:15 ` Nick Desaulniers
2026-07-27 0:10 ` Karl Mehltretter
2026-07-27 1:28 ` Karl Mehltretter [this message]
2026-07-27 1:37 ` Karl Mehltretter
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=amazbT2M9PQgb_Vq@gmail.com \
--to=kmehltretter@gmail.com \
--cc=arnd@arndb.de \
--cc=bigeasy@linutronix.de \
--cc=justinstitt@google.com \
--cc=kees@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=llvm@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=michal.pecio@gmail.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=samitolvanen@google.com \
--cc=thunder.leizhen@huawei.com \
--cc=will@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.