Skip to contentSkip to conversation

mempool-skip-slub_debug-poisoning-when-kasan-is-enabled.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Dec 29, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mempool: skip slub_debug poisoning when KASAN is enabled
has been removed from the -mm tree. Its filename was
mempool-skip-slub_debug-poisoning-when-kasan-is-enabled.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Andrey Konovalov <[email protected]>
Subject: mempool: skip slub_debug poisoning when KASAN is enabled
Date: Tue, 19 Dec 2023 23:28:57 +0100

With the changes in the following patch, KASAN starts saving its metadata within freed mempool elements.

Thus, skip slub_debug poisoning and checking of mempool elements when KASAN is enabled. Corruptions of freed mempool elements will be detected by KASAN anyway.

Cc Alexander Lobakin <[email protected]>
Cc Alexander Potapenko <[email protected]>
Cc Andrey Ryabinin <[email protected]>
Cc Breno Leitao <[email protected]>
Cc Dmitry Vyukov <[email protected]>
Cc Evgenii Stepanov <[email protected]>
Cc Marco Elver <[email protected]>

---

 mm/mempool.c |    8 ++++++++
 1 file changed, 8 insertions(+)
mm/mempool.c renamed from mm/mempool.c~mempool-skip-slub_debug-poisoning-when-kasan-is-enabled +8 -0
@@ -56,6 +56,10 @@ static void __check_element(mempool_t *p
 
 static void check_element(mempool_t *pool, void *element)
 {
+	/* Skip checking: KASAN might save its metadata in the element. */
+	if (kasan_enabled())
+		return;
+
 	/* Mempools backed by slab allocator */
 	if (pool->free == mempool_kfree) {
 		__check_element(pool, element, (size_t)pool->pool_data);
@@ -81,6 +85,10 @@ static void __poison_element(void *eleme
 
 static void poison_element(mempool_t *pool, void *element)
 {
+	/* Skip poisoning: KASAN might save its metadata in the element. */
+	if (kasan_enabled())
+		return;
+
 	/* Mempools backed by slab allocator */
 	if (pool->alloc == mempool_kmalloc) {
 		__poison_element(element, (size_t)pool->pool_data);

_

Patches currently in -mm which might be from [email protected] are

kasan-stop-leaking-stack-trace-handles.patch