From: Hao-Yu Yang <naup96721@gmail.com>
To: Eric Dumazet <edumazet@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
security@kernel.org, tglx@kernel.org, mingo@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] futex: Use-after-free between futex_key_to_node_opt and vma_replace_policy
Date: Fri, 13 Mar 2026 21:01:08 +0800 [thread overview]
Message-ID: <abQKlE1kr0oItUPu@naup-virtual-machine> (raw)
In-Reply-To: <CANn89iL3mix=i5=2bw2=g7BzfvY=YdL14E=0gFYnCZZ=KWHQhg@mail.gmail.com>
On Fri, Mar 13, 2026 at 01:55:07PM +0100, Eric Dumazet wrote:
> On Fri, Mar 13, 2026 at 1:53 PM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Fri, Mar 13, 2026 at 08:39:40PM +0800, Hao-Yu Yang wrote:
> > > During futex_key_to_node_opt() execution, vma->vm_policy is read under
> > > speculative mmap lock and RCU. Concurrently, mbind() may call
> > > vma_replace_policy() which frees the old mempolicy immediately via
> > > kmem_cache_free().
> > >
> > > This creates a race where __futex_key_to_node() dereferences a freed
> > > mempolicy pointer, causing a use-after-free read of mpol->mode.
> > >
>
> >
> > I would try and trim that trace, there is a lot of stuff that isn't
> > really relevant.
> >
> > > Fix by adding rcu to __mpol_put().
> > >
> > > Fixes: c042c505210d ("futex: Implement FUTEX2_MPOL")
> > > Reported-by: Hao-Yu Yang <naup96721@gmail.com>
> > > Signed-off-by: Hao-Yu Yang <naup96721@gmail.com>
> >
> > I would further suggest:
> >
> > Suggested-by: Eric Dumazet <edumazet@google.com>
>
> Reviewed-by: Eric Dumazet <edumazet@google.com>
>
> >
> > But yeah, other than that:
> >
> > Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>
> Thanks
Sorry, should I not have resent the entire patch? I just cc stable when I resent the entire patch.
next prev parent reply other threads:[~2026-03-13 13:01 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 12:39 Hao-Yu Yang
2026-03-13 12:44 ` Greg KH
2026-03-13 12:51 ` Hao-Yu Yang
2026-03-13 12:52 ` Peter Zijlstra
2026-03-13 12:55 ` Eric Dumazet
2026-03-13 13:01 ` Hao-Yu Yang [this message]
2026-03-13 12:47 Hao-Yu Yang
2026-03-21 23:57 ` Hao-Yu Yang
2026-03-22 21:42 ` Thomas Gleixner
2026-03-23 17:24 ` Thomas Gleixner
2026-03-23 23:43 ` Hao-Yu Yang
2026-03-23 23:46 ` Hao-Yu Yang
2026-03-24 14:00 ` Peter Zijlstra
2026-03-24 15:54 ` Hao-Yu Yang
2026-03-24 16:36 ` Thomas Gleixner
2026-03-24 17:44 ` Peter Zijlstra
2026-03-24 19:25 ` Thomas Gleixner
2026-03-24 20:27 ` David Hildenbrand (Arm)
2026-03-25 15:14 ` Peter Zijlstra
2026-03-25 15:19 ` Eric Dumazet
2026-03-25 15:22 ` Peter Zijlstra
2026-03-25 15:24 ` David Hildenbrand (Arm)
2026-03-25 15:25 ` Eric Dumazet
2026-03-26 12:42 ` Hao-Yu Yang
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=abQKlE1kr0oItUPu@naup-virtual-machine \
--to=naup96721@gmail.com \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=security@kernel.org \
--cc=tglx@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®