mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + kasan-fix-memory-leak-of-kasan-quarantine.patch added to -mm tree
@ 2020-12-18  3:28 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-12-18  3:28 UTC (permalink / raw)
  To: mm-commits, stable, matthias.bgg, glider, dvyukov, aryabinin,
	Kuan-Ying.Lee


The patch titled
     Subject: kasan: fix memory leak of kasan quarantine
has been added to the -mm tree.  Its filename is
     kasan-fix-memory-leak-of-kasan-quarantine.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/kasan-fix-memory-leak-of-kasan-quarantine.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/kasan-fix-memory-leak-of-kasan-quarantine.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Subject: kasan: fix memory leak of kasan quarantine

When cpu is going offline, set q->offline as true and interrupt happened. 
The interrupt may call the quarantine_put.  But quarantine_put do not free
the the object.  The object will cause memory leak.

Add qlink_free() to free the object.

Link: https://lkml.kernel.org/r/1608207487-30537-2-git-send-email-Kuan-Ying.Lee@mediatek.com
Fixes: 6c82d45c7f03 (kasan: fix object remaining in offline per-cpu quarantine)
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: <stable@vger.kernel.org>    [5.10-]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/kasan/quarantine.c |    1 +
 1 file changed, 1 insertion(+)

--- a/mm/kasan/quarantine.c~kasan-fix-memory-leak-of-kasan-quarantine
+++ a/mm/kasan/quarantine.c
@@ -191,6 +191,7 @@ void quarantine_put(struct kasan_free_me
 
 	q = this_cpu_ptr(&cpu_quarantine);
 	if (q->offline) {
+		qlink_free(&info->quarantine_link, cache);
 		local_irq_restore(flags);
 		return;
 	}
_

Patches currently in -mm which might be from Kuan-Ying.Lee@mediatek.com are

kasan-fix-memory-leak-of-kasan-quarantine.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-18  3:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18  3:28 + kasan-fix-memory-leak-of-kasan-quarantine.patch added to -mm tree akpm

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).