]> git.baikalelectronics.ru Git - kernel.git/commit
kasan: unify code between kasan_slab_free() and kasan_poison_kfree()
authorDmitry Vyukov <dvyukov@google.com>
Tue, 6 Feb 2018 23:36:34 +0000 (15:36 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Feb 2018 02:32:43 +0000 (18:32 -0800)
commit37204428c36720e752058aded28041025ccc5c12
treeff58cbb66f85207a812ad0e60c9eb66f5cef9620
parente26e58ce445ecbf85b2288eaf01c5ae370ccdcad
kasan: unify code between kasan_slab_free() and kasan_poison_kfree()

Both of these functions deal with freeing of slab objects.
However, kasan_poison_kfree() mishandles SLAB_TYPESAFE_BY_RCU
(must also not poison such objects) and does not detect double-frees.

Unify code between these functions.

This solves both of the problems and allows to add more common code
(e.g. detection of invalid frees).

Link: http://lkml.kernel.org/r/385493d863acf60408be219a021c3c8e27daa96f.1514378558.git.dvyukov@google.com
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>a
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/kasan/kasan.c