Kuniyuki Iwashima
071876fd50
ref_tracker: Don't use __GFP_NOFAIL for PF_MEMALLOC thread.
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.
[0]:
current->flags & PF_MEMALLOC
WARNING: mm/page_alloc.c:4816 at __alloc_pages_slowpath mm/page_alloc.c:4816 [inline], CPU#0: cifsd/12032
WARNING: mm/page_alloc.c:4816 at __alloc_frozen_pages_noprof+0x1eac/0x3300 mm/page_alloc.c:5449, CPU#0: cifsd/12032
Modules linked in:
CPU: 0 UID: 0 PID: 12032 Comm: cifsd Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__alloc_pages_slowpath mm/page_alloc.c:4816 [inline]
RIP: 0010:__alloc_frozen_pages_noprof+0x1eac/0x3300 mm/page_alloc.c:5449
Code: 38 d0 7c 08 84 d2 0f 85 de 12 00 00 65 48 8b 05 e2 a7 1c 12 c7 84 24 94 00 00 00 00 80 00 00 f6 40 2d 08 0f 84 ba e7 ff ff 90 <0f> 0b 90 e9 b1 e7 ff ff 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03
RSP: 0000:ffffc90002e172d0 EFLAGS: 00010202
RAX: ffff888029380000 RBX: 0000000000000000 RCX: 1ffff1100fffad29
RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff88803fffd938
RBP: ffff88802938002c R08: 0000000000008000 R09: 0000000000000001
R10: 0000000000000002 R11: 0000000000000000 R12: 00000000000cac40
R13: ffff88803fffb900 R14: 0000000000000000 R15: 1ffff920005c2e74
FS: 0000000000000000(0000) GS:ffff888096955000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000008000a000 CR3: 00000000403b5000 CR4: 0000000000352ef0
Call Trace:
<TASK>
alloc_slab_page mm/slub.c:3347 [inline]
allocate_slab mm/slub.c:3470 [inline]
new_slab+0x1f6/0x6e0 mm/slub.c:3513
refill_objects+0xe3/0x410 mm/slub.c:7417
refill_sheaf mm/slub.c:2885 [inline]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774
alloc_from_pcs mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:4984 [inline]
__kmalloc_cache_noprof+0x4f4/0x6d0 mm/slub.c:5559
_kmalloc_noprof include/linux/slab.h:991 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
ref_tracker_alloc+0x190/0x590 lib/ref_tracker.c:270
__netns_tracker_alloc include/net/net_namespace.h:370 [inline]
sk_alloc+0xcfc/0xe80 net/core/sock.c:2329
inet_create net/ipv4/af_inet.c:333 [inline]
inet_create+0x3a0/0x1060 net/ipv4/af_inet.c:259
__sock_create+0x339/0x860 net/socket.c:1676
generic_ip_connect+0x826/0x1810 fs/smb/client/connect.c:3377
__cifs_reconnect+0x348/0xa80 fs/smb/client/connect.c:420
_cifs_reconnect fs/smb/client/connect.c:596 [inline]
cifs_reconnect fs/smb/client/connect.c:610 [inline]
cifs_readv_from_socket+0x7c1/0xa30 fs/smb/client/connect.c:749
cifs_read_from_socket+0xb8/0x100 fs/smb/client/connect.c:804
cifs_demultiplex_thread+0x2db/0x2ea0 fs/smb/client/connect.c:1295
kthread+0x373/0x450 kernel/kthread.c:436
ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
</TASK>
Cc: [email protected] # ref_tracker is debug instrumentation
Fixes: 4e66934eaa ("lib: add reference counting tracking infrastructure")
Reported-by: [email protected]
Closes: https://lore.kernel.org/netdev/[email protected]/
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
2026-10-01 18:39:54 -07:00
..
2025-02-09 18:08:11 +08:00
2026-05-28 13:14:23 -07:00
2026-08-10 20:17:56 -07:00
2026-02-21 17:09:51 -08:00
2026-07-06 17:38:49 +10:00
2026-08-19 09:10:07 -07:00
2025-01-24 22:47:28 -08:00
2025-08-16 17:24:31 +08:00
2026-08-25 09:38:50 -07:00
2026-02-21 17:09:51 -08:00
2026-08-03 21:10:16 -07:00
2026-02-21 17:09:51 -08:00
2026-07-15 09:00:11 -07:00
2026-09-04 21:37:00 -07:00
2026-08-10 16:27:14 +02:00
2026-08-13 15:42:05 -07:00
2025-03-16 22:30:49 -07:00
2024-07-03 19:30:23 -07:00
2026-02-21 17:09:51 -08:00
2025-03-26 21:35:28 -07:00
2026-06-21 14:09:49 -07:00
2025-04-11 17:32:37 -07:00
2024-06-24 22:25:06 -07:00
2026-07-23 18:23:45 +03:00
2025-02-28 11:42:34 +01:00
2025-01-22 15:07:01 -05:00
2026-03-05 22:16:08 -05:00
2026-05-28 21:24:43 -07:00
2024-09-01 20:43:33 -07:00
2026-03-27 21:19:48 -07:00
2026-07-22 15:38:37 -04:00
2026-07-22 15:38:38 -04:00
2026-05-28 11:39:16 -04:00
2026-07-02 21:15:45 +09:00
2025-09-13 17:32:53 -07:00
2026-02-21 01:02:28 -08:00
2026-07-10 10:26:58 -06:00
2026-01-20 19:44:15 -08:00
2026-02-05 14:10:00 -08:00
2025-11-21 18:42:01 +00:00
2024-10-30 15:29:59 +01:00
2024-09-01 20:43:29 -07:00
2025-09-08 14:58:50 -07:00
2026-05-28 21:24:50 -07:00
2024-04-09 22:06:00 -07:00
2026-08-24 18:43:12 -07:00
2026-05-26 17:15:30 -04:00
2026-02-21 17:09:51 -08:00
2025-02-24 16:37:23 -05:00
2026-06-22 16:38:57 +02:00
2026-01-05 16:43:33 +01:00
2026-03-27 21:19:43 -07:00
2024-10-02 17:23:23 -04:00
2024-07-28 15:49:18 -07:00
2024-10-02 17:23:23 -04:00
2026-02-22 12:05:31 -08:00
2025-09-22 20:10:58 -07:00
2025-05-05 16:18:09 -05:00
2026-02-21 01:02:28 -08:00
2024-06-24 22:25:11 -07:00
2025-10-05 10:48:33 -07:00
2025-09-13 17:32:52 -07:00
2026-02-21 17:09:51 -08:00
2025-03-25 06:26:55 -07:00
2026-07-02 21:15:45 +09:00
2026-05-28 21:24:57 -07:00
2025-05-11 17:54:06 -07:00
2025-09-13 17:32:46 -07:00
2025-01-12 20:21:00 -08:00
2025-09-22 15:52:44 -04:00
2026-07-22 15:38:36 -04:00
2026-03-23 13:33:51 -04:00
2026-01-26 19:03:46 -08:00
2024-03-13 00:03:21 -07:00
2025-09-28 11:36:13 -07:00
2024-09-09 09:41:47 -04:00
2026-07-07 10:42:28 -04:00
2026-02-21 17:09:51 -08:00
2026-01-20 19:44:19 -08:00
2025-11-06 11:51:04 -05:00
2026-02-21 01:02:28 -08:00
2026-03-27 21:19:42 -07:00
2026-08-19 19:55:05 -07:00
2025-10-14 14:45:22 -07:00
2024-04-22 17:11:20 -03:00
2025-03-01 21:00:22 +01:00
2024-10-29 07:14:29 +00:00
2026-09-10 14:44:39 -06:00
2024-08-20 17:13:40 +02:00
2026-08-03 21:10:09 -07:00
2026-08-27 09:17:06 -07:00
2025-09-21 14:21:58 -07:00
2025-08-28 16:58:46 -07:00
2024-12-17 13:46:53 -07:00
2025-10-27 16:22:02 -07:00
2026-01-07 12:16:03 -08:00
2026-01-26 19:07:09 -08:00
2026-04-09 14:36:52 +02:00
2026-07-11 20:38:01 +02:00
2026-06-30 00:15:52 +01:00
2026-06-30 00:15:51 +01:00
2026-03-30 16:58:33 +02:00
2025-01-25 20:22:23 -08:00
2026-04-02 23:36:22 -07:00
2025-05-27 19:40:34 -07:00
2026-08-10 10:50:19 +02:00
2026-07-31 10:09:12 +02:00
2026-02-21 17:09:51 -08:00
2024-10-14 16:33:24 -05:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-08-25 08:59:09 -07:00
2026-08-24 18:43:32 -07:00
2025-03-16 23:24:14 -07:00
2025-03-19 19:17:58 +01:00
2024-02-22 19:01:55 -08:00
2026-08-10 09:00:05 -07:00
2026-02-22 08:26:33 -08:00
2026-02-12 15:45:57 -08:00
2025-05-11 17:54:13 -07:00
2026-09-01 20:26:22 -07:00
2024-12-11 20:13:00 -08:00
2024-12-11 20:13:00 -08:00
2026-02-21 17:09:51 -08:00
2026-04-02 23:36:24 -07:00
2024-09-01 20:43:34 -07:00
2024-11-06 20:11:14 -08:00
2026-07-28 21:11:55 -07:00
2026-01-11 06:09:11 -10:00
2026-08-03 21:10:09 -07:00
2025-11-20 14:03:45 -08:00
2026-02-21 17:09:51 -08:00
2026-02-27 16:40:16 +01:00
2025-01-29 15:21:31 +01:00
2026-10-01 18:39:54 -07:00
2026-07-28 19:08:58 -04:00
2026-07-31 17:28:24 +10:00
2025-08-07 06:30:17 -06:00
2026-07-01 15:26:29 +02:00
2026-07-31 10:09:14 +02:00
2026-02-21 01:02:28 -08:00
2024-10-02 17:23:23 -04:00
2025-07-10 17:52:13 +02:00
2025-04-01 15:20:46 -07:00
2026-02-21 17:09:51 -08:00
2026-05-13 10:54:08 -07:00
2026-08-03 21:10:06 -07:00
2025-11-18 15:27:35 +01:00
2025-11-18 15:27:35 +01:00
2025-11-20 14:03:43 -08:00
2026-07-22 15:38:37 -04:00
2024-05-09 09:25:08 -07:00
2026-04-20 17:57:36 -07:00
2026-05-28 12:20:19 +02:00
2026-02-21 17:09:51 -08:00
2024-06-04 17:40:02 +02:00
2026-06-11 11:42:21 -07:00
2024-09-01 20:43:40 -07:00
2024-05-19 14:36:20 -07:00
2024-05-19 14:36:20 -07:00
2024-06-24 22:25:11 -07:00
2024-06-24 22:25:11 -07:00
2026-08-04 19:18:54 -07:00
2026-08-27 09:17:06 -07:00
2025-03-25 10:18:31 -03:00
2026-04-18 00:10:48 -07:00
2025-05-11 17:54:09 -07:00
2026-04-27 05:54:25 -07:00
2026-02-21 17:09:51 -08:00
2026-06-19 10:14:34 -07:00
2024-06-24 22:25:11 -07:00
2026-02-21 17:09:51 -08:00
2025-09-09 12:27:18 +02:00
2026-02-21 17:09:51 -08:00
2025-06-19 17:02:04 -07:00
2026-09-04 21:37:00 -07:00
2024-06-24 22:25:11 -07:00
2024-06-24 22:25:11 -07:00
2026-08-05 15:28:23 +02:00
2025-04-15 13:50:17 -07:00
2026-06-02 15:22:32 -07:00
2026-09-04 21:37:00 -07:00
2025-05-11 17:48:19 -07:00
2026-06-30 00:15:52 +01:00
2026-02-27 16:40:16 +01:00
2026-03-27 21:19:44 -07:00
2024-06-24 22:25:04 -07:00
2026-03-27 21:19:44 -07:00
2025-08-25 06:11:06 -07:00
2025-03-07 19:58:05 -08:00
2026-08-05 11:20:12 -07:00
2024-07-30 13:04:36 -10:00
2026-05-28 21:24:44 -07:00
2026-03-27 21:19:41 -07:00
2026-08-25 09:38:50 -07:00
2024-12-09 13:48:29 -08:00
2026-08-24 18:42:59 -07:00
2025-11-12 10:00:17 -08:00