linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kasan: fix slab double free when cpu-hotplug
@ 2020-12-04 10:22 qiang.zhang
  2020-12-04 12:01 ` Kuan-Ying Lee
  0 siblings, 1 reply; 9+ messages in thread
From: qiang.zhang @ 2020-12-04 10:22 UTC (permalink / raw)
  To: aryabinin, dvyukov
  Cc: akpm, andreyknvl, qcai, kuan-ying.lee, linux-mm, linux-kernel

From: Zqiang <qiang.zhang@windriver.com>

When a CPU offline, the per-cpu quarantine's offline be set true,
after this, if the quarantine_put be called in this CPU, the objects
will be free and return false, free objects doesn't to be done, due
to return false, the slab memory manager will free this objects.

Fixes: 41ab1aae781f ("kasan: fix object remaining in offline per-cpu quarantine")
Signed-off-by: Zqiang <qiang.zhang@windriver.com>
---
 mm/kasan/quarantine.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c
index d98b516f372f..55783125a767 100644
--- a/mm/kasan/quarantine.c
+++ b/mm/kasan/quarantine.c
@@ -194,7 +194,6 @@ bool quarantine_put(struct kmem_cache *cache, void *object)
 
 	q = this_cpu_ptr(&cpu_quarantine);
 	if (q->offline) {
-		qlink_free(&meta->quarantine_link, cache);
 		local_irq_restore(flags);
 		return false;
 	}
-- 
2.17.1


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

end of thread, other threads:[~2020-12-11 21:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-04 10:22 [PATCH] kasan: fix slab double free when cpu-hotplug qiang.zhang
2020-12-04 12:01 ` Kuan-Ying Lee
2020-12-05  1:25   ` Andrew Morton
2020-12-05 16:17     ` Kuan-Ying Lee
2020-12-06  1:09       ` Andrew Morton
2020-12-07  2:06         ` Kuan-Ying Lee
2020-12-07  7:00           ` Kuan-Ying Lee
2020-12-11 13:43         ` Chris Down
2020-12-11 19:39           ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).