From: Harry Yoo <harry@kernel.org>
To: Kuniyuki Iwashima <kuniyu@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Vlastimil Babka <vbabka@kernel.org>,
Alexander Potapenko <glider@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
kasan-dev@googlegroups.com, linux-mm@kvack.org
Subject: Re: [PATCH v3 2/2] mm/kasan/kunit: Add double-free tests involving kfree_rcu_sheaf().
Date: Thu, 29 Oct 2026 13:53:42 +0000 [thread overview]
Message-ID: <auNNesYcV9gIdfBG@thinkstation> (raw)
In-Reply-To: <CAAVpQUCphsL1zUaFL8ryHETRZsRg6iLUUc2onrMd4nK5uP9XjA@mail.gmail.com>
On Wed, Oct 28, 2026 at 09:51:59PM -0700, Kuniyuki Iwashima wrote:
> On Wed, Oct 28, 2026 at 9:46 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > On Wed, 28 Oct 2026 19:39:20 +0000 Kuniyuki Iwashima <kuniyu@google.com> wrote:
> >
> > > The new test cases verify that KASAN immediately detects all
> > > three combinations of double-free involving kfree_rcu_sheaf():
> > >
> > > 1. kmem_cache_free() -> kfree_rcu()
> > > 2. kfree_rcu() -> kmem_cache_free()
> > > 3. kfree_rcu() -> kfree_rcu()
> > >
> > > Each test also evicts the object from the KASAN quarantine and
> > > reallocates it as a victim object before flushing the RCU sheaf
> > > to ensure the live victim object is not poisoned by the rejected
> > > double-free.
> > >
> > > Without the patch, all tests fail to detect the 2nd free, and
> > > the victim is poisoned:
> > >
> > > ...
> > >
> > > With the patch, all tests can detect the 2nd free immediately and
> > > prevent the victim from being poisoned:
> > >
> > > Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
> > > Reviewed-by: Alexander Potapenko <glider@google.com>
> >
> > Thanks. I believe this should have
> >
> > Fixes: ec66e0d59952 ("slab: add sheaf support for batching kfree_rcu() operations")
Looks correct to me.
> > and that both patches deserve a cc:stable. Please comfirm.
At least KASAN parts deserve it assuming people use KASAN for testing
and fuzzing.
> I was not sure if a new KUnit test deserved it, but I have no
> strong opinion, and I'm fine with that.
--
Cheers,
Harry / Hyeonggon
prev parent reply other threads:[~2026-10-29 13:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 19:39 [PATCH v3 0/2] mm/kasan: Detect double-free involving kfree_rcu_sheaf() Kuniyuki Iwashima
2026-10-28 19:39 ` [PATCH v3 1/2] " Kuniyuki Iwashima
2026-10-29 14:07 ` Harry Yoo
2026-10-28 19:39 ` [PATCH v3 2/2] mm/kasan/kunit: Add double-free tests " Kuniyuki Iwashima
2026-10-29 4:46 ` Andrew Morton
2026-10-29 4:51 ` Kuniyuki Iwashima
2026-10-29 13:53 ` Harry Yoo [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=auNNesYcV9gIdfBG@thinkstation \
--to=harry@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=cl@gentwo.org \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=hao.li@linux.dev \
--cc=kasan-dev@googlegroups.com \
--cc=kuniyu@google.com \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=ryabinin.a.a@gmail.com \
--cc=vbabka@kernel.org \
--cc=vincenzo.frascino@arm.com \
/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.