mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: "Shubhang Kaushik (Ampere)" <sh@gentwo.org>
Cc: "Thomas Gleixner" <tglx@kernel.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Darren Hart" <dvhart@infradead.org>,
	"Davidlohr Bueso" <dave@stgolabs.net>,
	"André Almeida" <andrealmeid@igalia.com>,
	"Shuah Khan" <shuah@kernel.org>, "Will Deacon" <will@kernel.org>,
	"Kees Cook" <kees@kernel.org>,
	"Andrey Konovalov" <andreyknvl@gmail.com>,
	"Shubhang Kaushik" <shubhang@os.amperecomputing.com>,
	"Christoph Lameter (Ampere)" <cl@gentwo.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] futex: Canonicalize arm64 tagged user addresses
Date: Fri, 23 Oct 2026 18:18:59 +0100	[thread overview]
Message-ID: <atuXA9WPEnwG0PCh@arm.com> (raw)
In-Reply-To: <20261022-futex-arm64-tagged-uaddr-v1-1-84d8afbe7668@gentwo.org>

On Thu, Oct 22, 2026 at 07:06:02PM -0700, Shubhang Kaushik (Ampere) wrote:
> On arm64, a thread that enables the tagged address ABI can pass valid
> top-byte-tagged user pointers to futex syscalls. Such a pointer must
> have the same syscall behaviour as its untagged form.
> 
> get_futex_key() validates the user address with access_ok(), but uses
> the raw address when constructing private and shared-anonymous futex
> keys. A waiter using a tagged address and a waker using the untagged
> form can therefore access the same futex word while hashing to distinct
> keys, causing FUTEX_WAKE to miss the waiter.
> 
> Keep access_ok() on the original pointer so that arm64 retains its
> per-thread tagged-address ABI enforcement. Canonicalize the address
> afterwards, before it is used for futex key construction and shared
> mapping lookup.
> 
> Add an arm64 64-bit selftest for a tagged private waiter woken through
> the corresponding untagged address.
> 
> Fixes: 63f0c6037965 ("arm64: Introduce prctl() options to control the tagged user addresses ABI")
> Cc: stable@vger.kernel.org
> Signed-off-by: Shubhang Kaushik (Ampere) <sh@gentwo.org>

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>

The patch is fairly generic but I guess at the moment it only affects
arm64 (on x86, access_ok() on tagged pointers still fails).

Thomas, do you have any preference for this patch? Happy for it to go
via tip.

Thanks.

-- 
Catalin

      reply	other threads:[~2026-10-23 17:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  2:06 Shubhang Kaushik (Ampere)
2026-10-23 17:18 ` Catalin Marinas [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=atuXA9WPEnwG0PCh@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=andrealmeid@igalia.com \
    --cc=andreyknvl@gmail.com \
    --cc=cl@gentwo.org \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sh@gentwo.org \
    --cc=shuah@kernel.org \
    --cc=shubhang@os.amperecomputing.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®