syzbot


BUG: sleeping function called from invalid context in kmem_cache_alloc_node_trace

Status: fixed on 2020/05/10 10:41
Subsystems: net
[Documentation on labels]
Fix commit: 138470a9b2cc net/sched: act_ct: fix lockdep splat in tcf_ct_flow_table_get
First crash: 1679d, last: 1677d
Cause bisection: introduced by (bisect log) :
commit c34b961a249211bdb08d03bdecfb31ff22eb002f
Author: Paul Blakey <paulb@mellanox.com>
Date: Tue Mar 3 13:07:49 2020 +0000

  net/sched: act_ct: Create nf flow table per zone

Crash: BUG: sleeping function called from invalid context in kmem_cache_alloc_node_trace (log)
Repro: C syz .config
  

Sample crash report:
BUG: sleeping function called from invalid context at mm/slab.h:565
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 9582, name: syz-executor610
2 locks held by syz-executor610/9582:
 #0: ffffffff8a34eb80 (rtnl_mutex){+.+.}, at: rtnl_lock net/core/rtnetlink.c:72 [inline]
 #0: ffffffff8a34eb80 (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x3f9/0xad0 net/core/rtnetlink.c:5437
 #1: ffffffff8a3961b8 (zones_lock){+...}, at: spin_lock_bh include/linux/spinlock.h:343 [inline]
 #1: ffffffff8a3961b8 (zones_lock){+...}, at: tcf_ct_flow_table_get+0xa3/0x1700 net/sched/act_ct.c:67
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 0 PID: 9582 Comm: syz-executor610 Not tainted 5.6.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 ___might_sleep.cold+0x1f4/0x23d kernel/sched/core.c:6798
 slab_pre_alloc_hook mm/slab.h:565 [inline]
 slab_alloc_node mm/slab.c:3227 [inline]
 kmem_cache_alloc_node_trace+0x272/0x790 mm/slab.c:3593
 __do_kmalloc_node mm/slab.c:3615 [inline]
 __kmalloc_node+0x38/0x60 mm/slab.c:3623
 kmalloc_node include/linux/slab.h:578 [inline]
 kvmalloc_node+0x61/0xf0 mm/util.c:574
 kvmalloc include/linux/mm.h:645 [inline]
 kvzalloc include/linux/mm.h:653 [inline]
 bucket_table_alloc+0x8b/0x480 lib/rhashtable.c:175
 rhashtable_init+0x3d2/0x750 lib/rhashtable.c:1054
 nf_flow_table_init+0x16d/0x310 net/netfilter/nf_flow_table_core.c:498
 tcf_ct_flow_table_get+0xe33/0x1700 net/sched/act_ct.c:82
 tcf_ct_init+0xba4/0x18a6 net/sched/act_ct.c:1050
 tcf_action_init_1+0x697/0xa20 net/sched/act_api.c:945
 tcf_action_init+0x1e9/0x2f0 net/sched/act_api.c:1001
 tcf_action_add+0xdb/0x370 net/sched/act_api.c:1411
 tc_ctl_action+0x366/0x456 net/sched/act_api.c:1466
 rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5440
 netlink_rcv_skb+0x15a/0x410 net/netlink/af_netlink.c:2478
 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
 netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329
 netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x6b9/0x7d0 net/socket.c:2343
 ___sys_sendmsg+0x100/0x170 net/socket.c:2397
 __sys_sendmsg+0xec/0x1b0 net/socket.c:2430
 do_syscall_64+0xf6/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4403d9
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd719af218 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 00000000004403d9
RDX: 0000000000000000 RSI: 0000000020000300 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000005 R09: 00000000004002c8
R10: 0000000000000008 R11: 00000000000

Crashes (364):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/07 14:53 net-next-old 425c075dcbb2 2e9971bb .config console log report syz C ci-upstream-net-kasan-gce
2020/03/09 18:45 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 17:43 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 16:09 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 14:36 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 13:27 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 13:09 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 12:07 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 10:41 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 09:30 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 08:29 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 08:24 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 07:24 net-next-old caf48383f1e6 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 05:56 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 04:53 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 04:51 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 03:44 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 02:37 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 01:08 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/09 00:32 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 23:27 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 22:08 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 21:55 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 20:50 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 19:44 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 19:41 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 18:39 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 17:34 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 16:44 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 15:37 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 15:03 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 14:00 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 12:54 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 11:43 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 11:00 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 09:56 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 09:48 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 07:35 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 06:34 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 05:30 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 03:49 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/08 02:48 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
2020/03/07 12:52 net-next-old 425c075dcbb2 2e9971bb .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.