mm: kfence: fix PG_slab and memcg_data clearing
authorMuchun Song <songmuchun@bytedance.com>
Mon, 20 Mar 2023 03:00:59 +0000 (11:00 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 28 Mar 2023 22:24:32 +0000 (15:24 -0700)
commit3ee2d7471fa4963a2ced0a84f0653ce88b43c5b2
treebd2e7627edc8846878da282c67210dcc553e8d71
parente900ba10d15041a6236cc75778cc6e06c3590a58
mm: kfence: fix PG_slab and memcg_data clearing

It does not reset PG_slab and memcg_data when KFENCE fails to initialize
kfence pool at runtime.  It is reporting a "Bad page state" message when
kfence pool is freed to buddy.  The checking of whether it is a compound
head page seems unnecessary since we already guarantee this when
allocating kfence pool.   Remove the check to simplify the code.

Link: https://lkml.kernel.org/r/20230320030059.20189-1-songmuchun@bytedance.com
Fixes: 0ce20dd84089 ("mm: add Kernel Electric-Fence infrastructure")
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: SeongJae Park <sjpark@amazon.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kfence/core.c