Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/mempool: avoid KASAN marking mempool poison checks as use-after-free

When removing an element from the mempool, mark it as unpoisoned in KASAN
before verifying its contents for SLUB/SLAB debugging. Otherwise KASAN
will flag the reads checking the element use-after-free writes as
use-after-free reads.

Signed-off-by: Matthew Dawson <matthew@mjdsystems.ca>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Matthew Dawson and committed by
Linus Torvalds
76401310 2a4fb270

+1 -1
+1 -1
mm/mempool.c
··· 135 135 void *element = pool->elements[--pool->curr_nr]; 136 136 137 137 BUG_ON(pool->curr_nr < 0); 138 - check_element(pool, element); 139 138 kasan_unpoison_element(pool, element); 139 + check_element(pool, element); 140 140 return element; 141 141 } 142 142