Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] mm/kasan: Detect double-free involving kfree_rcu_sheaf().
@ 2026-10-09 21:46 Kuniyuki Iwashima
  2026-10-09 21:46 ` [PATCH 1/2] " Kuniyuki Iwashima
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Kuniyuki Iwashima @ 2026-10-09 21:46 UTC (permalink / raw)
  To: Andrey Ryabinin, Andrew Morton, Vlastimil Babka, Harry Yoo
  Cc: Alexander Potapenko, Andrey Konovalov, Dmitry Vyukov,
	Vincenzo Frascino, Hao Li, Christoph Lameter, David Rientjes,
	Roman Gushchin, kasan-dev, linux-mm, Kuniyuki Iwashima

Recently, syzbot has reported several weird use-after-free splats.

What they have in common is that "Freed by" points to rcu_free_sheaf(),
whereas the object shown in "Call Trace:" and "Allocated by" is never
supposed to be freed via kfree_rcu().

This means the object was a victim of a double-free somewhere else and
was silently poisoned by rcu_free_sheaf() after being reallocated.

This happens because kfree_rcu_sheaf() queues an object into the RCU
sheaf without invoking any KASAN hooks.

This series enables KASAN to detect double-free involving
kfree_rcu_sheaf() immediately and adds KUnit tests for it.


Kuniyuki Iwashima (2):
  mm/kasan: Detect double-free involving kfree_rcu_sheaf().
  mm/kasan/kunit: Add double-free tests involving kfree_rcu_sheaf().

 include/linux/kasan.h   |  13 ++--
 mm/kasan/common.c       |  13 ++--
 mm/kasan/generic.c      |  14 ++++-
 mm/kasan/kasan.h        |  34 ++++++++++-
 mm/kasan/kasan_test_c.c | 131 ++++++++++++++++++++++++++++++++++++++++
 mm/slub.c               |  13 +++-
 6 files changed, 204 insertions(+), 14 deletions(-)

-- 
2.56.0.385.gd3acb90ef8-goog



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-10-27 22:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09 21:46 [PATCH 0/2] mm/kasan: Detect double-free involving kfree_rcu_sheaf() Kuniyuki Iwashima
2026-10-09 21:46 ` [PATCH 1/2] " Kuniyuki Iwashima
2026-10-20 12:29   ` Vlastimil Babka (SUSE)
2026-10-27 12:48   ` Alexander Potapenko
2026-10-27 21:51     ` Kuniyuki Iwashima
2026-10-09 21:46 ` [PATCH 2/2] mm/kasan/kunit: Add double-free tests " Kuniyuki Iwashima
2026-10-27 12:48   ` Alexander Potapenko
2026-10-27 22:16     ` Kuniyuki Iwashima
2026-10-27  6:15 ` [PATCH 0/2] mm/kasan: Detect double-free " Kuniyuki Iwashima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox