From: Tetsuo Handa Date: Thu, 11 May 2023 13:47:32 +0000 (+0900) Subject: debugobjects: Don't wake up kswapd from fill_pool() X-Git-Tag: baikal/aarch64/sdk5.10~25 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=7406d89d8a84277415f0a7d204e3cdbb071f793f;p=kernel.git 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: 69c20efcf9e3 ("infrastructure to debug (dynamic) objects") Reported-by: syzbot Signed-off-by: Tetsuo Handa Signed-off-by: Thomas Gleixner 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 --- diff --git a/lib/debugobjects.c b/lib/debugobjects.c index bfb3eb8c98004..26fa04335537b 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -128,7 +128,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;