mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [merged] mm-slubc-add-a-naive-detection-of-double-free-or-corruption.patch removed from -mm tree
@ 2017-09-07 18:37 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-09-07 18:37 UTC (permalink / raw)
  To: alex.popov, cl, iamjoonsoo.kim, keescook, luto, mingo,
	mm-commits, nicolas.pitre, paulmck, penberg, riel, rientjes, tj,
	tycho


The patch titled
     Subject: mm/slub.c: add a naive detection of double free or corruption
has been removed from the -mm tree.  Its filename was
     mm-slubc-add-a-naive-detection-of-double-free-or-corruption.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Alexander Popov <alex.popov@linux.com>
Subject: mm/slub.c: add a naive detection of double free or corruption

Add an assertion similar to "fasttop" check in GNU C Library allocator as
a part of SLAB_FREELIST_HARDENED feature.  An object added to a singly
linked freelist should not point to itself.  That helps to detect some
double free errors (e.g.  CVE-2017-2636) without slub_debug and KASAN.

Link: http://lkml.kernel.org/r/1502468246-1262-1-git-send-email-alex.popov@linux.com
Signed-off-by: Alexander Popov <alex.popov@linux.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Paul E McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Tycho Andersen <tycho@docker.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/slub.c |    4 ++++
 1 file changed, 4 insertions(+)

diff -puN mm/slub.c~mm-slubc-add-a-naive-detection-of-double-free-or-corruption mm/slub.c
--- a/mm/slub.c~mm-slubc-add-a-naive-detection-of-double-free-or-corruption
+++ a/mm/slub.c
@@ -290,6 +290,10 @@ static inline void set_freepointer(struc
 {
 	unsigned long freeptr_addr = (unsigned long)object + s->offset;
 
+#ifdef CONFIG_SLAB_FREELIST_HARDENED
+	BUG_ON(object == fp); /* naive detection of double free or corruption */
+#endif
+
 	*(void **)freeptr_addr = freelist_ptr(s, fp, freeptr_addr);
 }
 
_

Patches currently in -mm which might be from alex.popov@linux.com are



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

only message in thread, other threads:[~2017-09-07 18:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-07 18:37 [merged] mm-slubc-add-a-naive-detection-of-double-free-or-corruption.patch removed from -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).