Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Patrick Lister" <patrick.lister.dev@gmail.com>,
	"Russell King" <linux@armlinux.org.uk>
Cc: "Ard Biesheuvel" <ardb@kernel.org>,
	"Linus Walleij" <linusw@kernel.org>,
	"Keith Packard" <keithpac@amazon.com>,
	"Nicolas Pitre" <nico@fluxnic.net>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	"Nick Clifton" <nickc@redhat.com>,
	"Richard Earnshaw" <richard.earnshaw@arm.com>,
	"Ramana Radhakrishnan" <ramanara@nvidia.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, "Riku Voipio" <riku.voipio@iki.fi>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	luis.machado.foss@gmail.com, thiago.bauermann@linaro.org
Subject: Re: [PATCH] ARM: nwfpe: use task_pt_regs() to find user registers
Date: Thu, 12 Nov 2026 08:58:53 +0100	[thread overview]
Message-ID: <0384a52a-31f6-4bbd-9de8-8efe73610e28@app.fastmail.com> (raw)
In-Reply-To: <20261112025159.473997-1-patrick.lister.dev@gmail.com>

On Thu, Nov 12, 2026, at 03:51, Patrick Lister wrote:
> NWFPE locates the trapping process's saved registers relative to
> current_thread_info(), assuming thread_info sits at the bottom of the
> kernel stack. Since ARM moved thread_info into task_struct, that
> expression points past the end of the task_struct instead.
>
> This breaks FPA instruction emulation, as the user registers are
> never read or written and causes out-of-bounds reads and writes of
> kernel memory beyond the task_struct. Any unprivileged process can
> trigger this.

Thanks a lot for chasing this down!

As I understand it, this means that nobody has seriously used or
tested OABI since 5.16. I last tested it myself in 5.14 when
working on 4e57a4ddf6b0 ("ARM: 9107/1: syscall: always store
thread_info->abi_syscall"), but it was quite hard to properly
test it at the time, even getting an old Debian rootfs to work
with a modern kernel and qemu was nontrivial.

> Fix by using task_pt_regs(current), which finds the registers on the
> stack.
>
> The bug was found with assistance from Claude Code (Anthropic), model
> Claude Opus 5.5 (claude-opus-5-5).
>
> Fixes: 18ed1c01a7dd ("ARM: smp: Enable THREAD_INFO_IN_TASK")
> Fixes: 9c46929e7989 ("ARM: implement THREAD_INFO_IN_TASK for
> uniprocessor systems")
> Cc: stable@vger.kernel.org # 5.16+
> Signed-off-by: Patrick Lister <patrick.lister.dev@gmail.com>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

The patch looks fine, and it's clearly harmless to merge as there
are no users, so please add it to the patch tracker according to
the instructions at https://www.arm.linux.org.uk/developer/patches/info.php

Hopefully this way we can have OABI/NWFPE in a working state for the
LTS backports when we remove it in the near future, in case
anyone ever wants to play with it later.

I've added the maintainers for the Arm ports in gcc, qemu and binutils
to Cc here, I believe all of these still have some level of OABI
support that they kept just because Linux still handles it, but
that can then also be removed.

      Arnd


  parent reply	other threads:[~2026-11-12  8:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  2:51 [PATCH] ARM: nwfpe: use task_pt_regs() to find user registers Patrick Lister
2026-11-12  7:58 ` Ard Biesheuvel
2026-11-12  7:58 ` Arnd Bergmann [this message]
2026-11-12  9:31   ` Peter Maydell

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=0384a52a-31f6-4bbd-9de8-8efe73610e28@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=alex.bennee@linaro.org \
    --cc=ardb@kernel.org \
    --cc=keithpac@amazon.com \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=luis.machado.foss@gmail.com \
    --cc=nickc@redhat.com \
    --cc=nico@fluxnic.net \
    --cc=patrick.lister.dev@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=ramanara@nvidia.com \
    --cc=richard.earnshaw@arm.com \
    --cc=riku.voipio@iki.fi \
    --cc=stable@vger.kernel.org \
    --cc=thiago.bauermann@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox