mm/mempool: Avoid KASAN marking mempool posion checks as use-after-free
Subsystems (2)
PATCH 1/1 mm/mempool: Avoid KASAN marking mempool posion 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.
--- mm/mempool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mempool.c +1 -1
@@ -135,8 +135,8 @@ static void *remove_element(mempool_t *pool)void *element = pool->elements[--pool->curr_nr];BUG_ON (pool->curr_nr <0 ); -check_element (pool, element);kasan_unpoison_element (pool, element); +check_element (pool, element);return element; }
Signature · 7 lines
2.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 6 lines · Matthew Dawson
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 <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>