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:37:16 +0200 [thread overview]
Message-ID: <ama1UiT1Jxy-PvVN@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:
> + /* Check for EOR/EORS immediate: cccc 0010 0x1n Rn Rd immediate */
> + if ((instr_prev & 0x0fe00000) == 0x02200000) {
> + /* Extract EOR immediate value and XOR to reconstruct type */
> + u32 rotate = (instr_prev >> 8) & 0xf;
> + u32 imm8 = instr_prev & 0xff;
> + u32 imm32 = (imm8 >> (rotate * 2)) | (imm8 << (32 - rotate * 2));
With CONFIG_UBSAN_SHIFT=y, I reproduced the following in QEMU with GCC
v14 KCFI and LKDTM CFI_FORWARD_PROTO:
UBSAN: shift-out-of-bounds in arch/arm/kernel/traps.c:555:48
shift exponent 32 is too large for 32-bit type 'unsigned int'
Could this use ror32() from <linux/bitops.h> instead?
Thanks,
Karl
prev parent reply other threads:[~2026-07-27 1:37 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
2026-07-27 1:37 ` Karl Mehltretter [this message]
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=ama1UiT1Jxy-PvVN@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.