]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/mempool.c: kasan: poison mempool elements
authorAndrey Ryabinin <a.ryabinin@samsung.com>
Tue, 7 Apr 2015 23:44:37 +0000 (09:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 7 Apr 2015 23:44:37 +0000 (09:44 +1000)
commita47069a81bad83953e0dec2f1e9355a3545775c8
tree079c64b3dbafa3f0eab1d4d24a018400c29d51b6
parent87ab364b673ca3f00000b32e67355000fd1eec5e
mm/mempool.c: kasan: poison mempool elements

Mempools keep allocated objects in reserved for situations when ordinary
allocation may not be possible to satisfy.  These objects shouldn't be
accessed before they leave the pool.

This patch poison elements when get into the pool and unpoison when they
leave it.  This will let KASan to detect use-after-free of mempool's
elements.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Tested-by: David Rientjes <rientjes@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Chernenkov <drcheren@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Alexander Potapenko <glider@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/kasan.h
mm/kasan/kasan.c
mm/mempool.c