All of lore.kernel.org
 help / color / mirror / Atom feed
From: qiang.zhang@windriver.com
To: aryabinin@virtuozzo.com, dvyukov@google.com
Cc: akpm@linux-foundation.org, andreyknvl@google.com,
	qcai@redhat.com, kuan-ying.lee@mediatek.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] kasan: fix slab double free when cpu-hotplug
Date: Fri,  4 Dec 2020 18:22:06 +0800	[thread overview]
Message-ID: <20201204102206.20237-1-qiang.zhang@windriver.com> (raw)

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


             reply	other threads:[~2020-12-04 10:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 10:22 qiang.zhang [this message]
2020-12-04 12:01 ` [PATCH] kasan: fix slab double free when cpu-hotplug 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

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=20201204102206.20237-1-qiang.zhang@windriver.com \
    --to=qiang.zhang@windriver.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=kuan-ying.lee@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=qcai@redhat.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.