Thread (3 messages) 3 messages, 3 authors, 18d ago

Re: [PATCH v1 net] ref_tracker: Don't use __GFP_NOFAIL for PF_MEMALLOC thread.

flat view

From: Eric Dumazet <edumazet@kernel.org>
Date: 2026-10-01 06:51:14

On Thu, Oct 1, 2026 at 12:01 AM Kuniyuki Iwashima [off-list ref] wrote:
syzbot triggered a warning in __alloc_pages_slowpath(). [0]

ref_tracker_alloc() uses __GFP_NOFAIL if the passed gfp has
__GFP_DIRECT_RECLAIM.

However, cifs_demultiplex_thread() calls memalloc_noreclaim_save()
and its kthread has PF_MEMALLOC.

As commented in __alloc_pages_slowpath(), __GFP_NOFAIL should
not be used for PF_MEMALLOC thread.

        if (unlikely(nofail)) {
...
                /*
                 * PF_MEMALLOC request from this context is rather bizarre
                 * because we cannot reclaim anything and only can loop waiting
                 * for somebody to do a work for us.
                 */
                WARN_ON_ONCE(current->flags & PF_MEMALLOC);

Let's avoid using __GFP_NOFAIL for PF_MEMALLOC thread.


Fixes: 4e66934eaadc ("lib: add reference counting tracking infrastructure")
Reported-by: syzbot+f95c2f0a71a98cef50eb@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/6abd860c.9b478af7.e8d7a.0000.GAE@google.com/ (local)
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
---
Reviewed-by: Eric Dumazet <edumazet@kernel.org>

Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help