+ kasan-slub-fix-handling-of-kasan_slab_free-hook-v2.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: kasan-slub-fix-handling-of-kasan_slab_free-hook-v2
has been added to the -mm tree.  Its filename is
     kasan-slub-fix-handling-of-kasan_slab_free-hook-v2.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/kasan-slub-fix-handling-of-kasan_slab_free-hook-v2.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/kasan-slub-fix-handling-of-kasan_slab_free-hook-v2.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: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
Subject: kasan-slub-fix-handling-of-kasan_slab_free-hook-v2

- Made slab_free_freelist_hook return bool and return true when KASAN is
  disabled. That should eliminate unnecessary branch in slab_free.

Link: http://lkml.kernel.org/r/a62759a2545fddf69b0c034547212ca1eb1b3ce2.1520359686.git.andreyknvl@xxxxxxxxxx
Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxx>
Cc: Pekka Enberg <penberg@xxxxxxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>
Cc: Alexander Potapenko <glider@xxxxxxxxxx>
Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
Cc: Kostya Serebryany <kcc@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/slub.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff -puN mm/slub.c~kasan-slub-fix-handling-of-kasan_slab_free-hook-v2 mm/slub.c
--- a/mm/slub.c~kasan-slub-fix-handling-of-kasan_slab_free-hook-v2
+++ a/mm/slub.c
@@ -1387,7 +1387,7 @@ static __always_inline bool slab_free_ho
 	return kasan_slab_free(s, x, _RET_IP_);
 }
 
-static inline void slab_free_freelist_hook(struct kmem_cache *s,
+static inline bool slab_free_freelist_hook(struct kmem_cache *s,
 					   void **head, void **tail)
 {
 /*
@@ -1422,6 +1422,10 @@ static inline void slab_free_freelist_ho
 
 	if (*head == *tail)
 		*tail = NULL;
+
+	return *head != NULL;
+#else
+	return true;
 #endif
 }
 
@@ -2980,8 +2984,7 @@ static __always_inline void slab_free(st
 	 * With KASAN enabled slab_free_freelist_hook modifies the freelist
 	 * to remove objects, whose reuse must be delayed.
 	 */
-	slab_free_freelist_hook(s, &head, &tail);
-	if (head != NULL)
+	if (slab_free_freelist_hook(s, &head, &tail))
 		do_slab_free(s, page, head, tail, cnt, addr);
 }
 
_

Patches currently in -mm which might be from andreyknvl@xxxxxxxxxx are

kasan-slub-fix-handling-of-kasan_slab_free-hook.patch
kasan-slub-fix-handling-of-kasan_slab_free-hook-v2.patch
kasan-fix-invalid-free-test-crashing-the-kernel.patch
kasan-disallow-compiler-to-optimize-away-memset-in-tests.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux