summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2023-05-11 22:47:32 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-30 13:55:31 +0100
commitaee97eec77029270866c704f66cdf2881cbd2fe1 (patch)
tree6bc7de755c997641256a267c8d77d1b66189c136
parentc09a7b6190f5a5d8324c84b8e88f02e9861af735 (diff)
downloadlinux-aee97eec77029270866c704f66cdf2881cbd2fe1.tar.gz
linux-aee97eec77029270866c704f66cdf2881cbd2fe1.tar.bz2
linux-aee97eec77029270866c704f66cdf2881cbd2fe1.zip
debugobjects: Don't wake up kswapd from fill_pool()
commit eb799279fb1f9c63c520fe8c1c41cb9154252db6 upstream. syzbot is reporting a lockdep warning in fill_pool() because the allocation from debugobjects is using GFP_ATOMIC, which is (__GFP_HIGH | __GFP_KSWAPD_RECLAIM) and therefore tries to wake up kswapd, which acquires kswapd_wait::lock. Since fill_pool() might be called with arbitrary locks held, fill_pool() should not assume that acquiring kswapd_wait::lock is safe. Use __GFP_HIGH instead and remove __GFP_NORETRY as it is pointless for !__GFP_DIRECT_RECLAIM allocation. Fixes: 3ac7fe5a4aab ("infrastructure to debug (dynamic) objects") Reported-by: syzbot <syzbot+fe0c72f0ccbb93786380@syzkaller.appspotmail.com> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/6577e1fa-b6ee-f2be-2414-a2b51b1c5e30@I-love.SAKURA.ne.jp Closes: https://syzkaller.appspot.com/bug?extid=fe0c72f0ccbb93786380 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--lib/debugobjects.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 824337ec36aa..4c39678c03ee 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -129,7 +129,7 @@ static const char *obj_states[ODEBUG_STATE_MAX] = {
static void fill_pool(void)
{
- gfp_t gfp = GFP_ATOMIC | __GFP_NORETRY | __GFP_NOWARN;
+ gfp_t gfp = __GFP_HIGH | __GFP_NOWARN;
struct debug_obj *obj;
unsigned long flags;