Linux/linux a710122mm slub.c

kasan, slub: move kasan_poison_slab hook before page_address

With tag based KASAN page_address() looks at the page flags to see whether
the resulting pointer needs to have a tag set.  Since we don't want to set
a tag when page_address() is called on SLAB pages, we call
page_kasan_tag_reset() in kasan_poison_slab().  However in allocate_slab()
page_address() is called before kasan_poison_slab().  Fix it by changing
the order.

[andreyknvl at google.com: fix compilation error when CONFIG_SLUB_DEBUG=n]
  Link: http://lkml.kernel.org/r/ac27cc0bbaeb414ed77bcd6671a877cf3546d56e.1550066133.git.andreyknvl@google.com
Link: http://lkml.kernel.org/r/cd895d627465a3f1c712647072d17f10883be2a1.1549921721.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl at google.com>
Cc: Alexander Potapenko <glider at google.com>
Cc: Andrey Ryabinin <aryabinin at virtuozzo.com>
Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: Christoph Lameter <cl at linux.com>
Cc: David Rientjes <rientjes at google.com>
Cc: Dmitry Vyukov <dvyukov at google.com>
Cc: Evgeniy Stepanov <eugenis at google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim at lge.com>
Cc: Kostya Serebryany <kcc at google.com>
Cc: Pekka Enberg <penberg at kernel.org>
Cc: Qian Cai <cai at lca.pw>
Cc: Vincenzo Frascino <vincenzo.frascino at arm.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
DeltaFile
+15-4mm/slub.c
+15-41 files

UnifiedSplitRaw