From: Hao-Yu Yang <naup96721@gmail.com>
To: Eric Dumazet <edumazet@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
"David Hildenbrand (Arm)" <david@kernel.org>,
Thomas Gleixner <tglx@kernel.org>,
mingo@redhat.com, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>
Subject: Re: [PATCH v2] futex: Use-after-free between futex_key_to_node_opt and vma_replace_policy
Date: Thu, 26 Mar 2026 20:42:55 +0800 [thread overview]
Message-ID: <acUpzzUMMN32WriG@naup-virtual-machine> (raw)
In-Reply-To: <CANn89i+cJ+BOs_swGU4vHbKPHVV+vqmHjaSywUxDzBu=nXfmtQ@mail.gmail.com>
I need to send patch v3? If i need how i need to change about this patch?
On Wed, Mar 25, 2026 at 08:25:29AM -0700, Eric Dumazet wrote:
> On Wed, Mar 25, 2026 at 8:22 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> > Fair enough. Like so then..
> >
> > --- a/kernel/futex/core.c
> > +++ b/kernel/futex/core.c
> > @@ -342,7 +342,7 @@ static int __futex_key_to_node(struct mm
> > if (!vma)
> > return FUTEX_NO_NODE;
> >
> > - mpol = vma_policy(vma);
> > + mpol = READ_ONCE(vma->vm_policy);
> > if (!mpol)
> > return FUTEX_NO_NODE;
> >
> > --- a/mm/mempolicy.c
> > +++ b/mm/mempolicy.c
> > @@ -1026,7 +1026,7 @@ static int vma_replace_policy(struct vm_
> > }
> >
> > old = vma->vm_policy;
> > - vma->vm_policy = new; /* protected by mmap_lock */
> > + WRITE_ONCE(vma->vm_policy, new); /* protected by mmap_lock */
> > mpol_put(old);
> >
> > return 0;
>
> LGTM, thanks !
>
> Reviewed-by: Eric Dumazet <edumazet@google.com>
next prev parent reply other threads:[~2026-03-26 12:43 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 12:47 [PATCH v2] futex: Use-after-free between futex_key_to_node_opt and vma_replace_policy 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 [this message]
2026-03-26 15:16 ` [tip: locking/urgent] futex: Fix UaF between futex_key_to_node_opt() and vma_replace_policy() tip-bot2 for Hao-Yu Yang
-- strict thread matches above, loose matches on Subject: below --
2026-03-13 12:39 [PATCH v2] futex: Use-after-free between futex_key_to_node_opt and vma_replace_policy 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
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=acUpzzUMMN32WriG@naup-virtual-machine \
--to=naup96721@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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 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.