syzbot


BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns

Status: fixed on 2023/02/24 13:50
Subsystems: kernfs
[Documentation on labels]
Reported-by: syzbot+9baaae5fc5795e2e6acf@syzkaller.appspotmail.com
Fix commit: 46307fd6e27a cgroup: Reorganize css_set_lock and kernfs path processing
First crash: 604d, last: 555d
Cause bisection: failed (error log, bisect log)
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns 3 (4) 2022/10/13 17:39
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns origin:lts-only C inconclusive 3410 1h10m 414d 0/3 upstream: reported C repro on 2023/03/07 18:28

Sample crash report:
BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1498
in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 3603, name: syz-executor323
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
INFO: lockdep is turned off.
irq event stamp: 0
hardirqs last  enabled at (0): [<0000000000000000>] 0x0
hardirqs last disabled at (0): [<ffffffff814710e0>] copy_process+0x20f0/0x7120 kernel/fork.c:2199
softirqs last  enabled at (0): [<ffffffff81471128>] copy_process+0x2138/0x7120 kernel/fork.c:2203
softirqs last disabled at (0): [<0000000000000000>] 0x0
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 PID: 3603 Comm: syz-executor323 Not tainted 6.0.0-rc3-next-20220830-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9896
 down_read+0x71/0x450 kernel/locking/rwsem.c:1498
 kernfs_walk_and_get_ns+0xcc/0x3a0 fs/kernfs/dir.c:897
 kernfs_walk_and_get include/linux/kernfs.h:600 [inline]
 cgroup_get_from_path+0x61/0x610 kernel/cgroup/cgroup.c:6647
 cgroup_mt_check_v1+0x19a/0x2f0 net/netfilter/xt_cgroup.c:56
 xt_check_match+0x275/0x9f0 net/netfilter/x_tables.c:523
 check_match net/ipv6/netfilter/ip6_tables.c:490 [inline]
 find_check_match net/ipv6/netfilter/ip6_tables.c:507 [inline]
 find_check_entry.constprop.0+0x342/0x9e0 net/ipv6/netfilter/ip6_tables.c:558
 translate_table+0xc8b/0x1750 net/ipv6/netfilter/ip6_tables.c:735
 do_replace net/ipv6/netfilter/ip6_tables.c:1153 [inline]
 do_ip6t_set_ctl+0x56e/0xb90 net/ipv6/netfilter/ip6_tables.c:1639
 nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101
 ipv6_setsockopt+0x127/0x190 net/ipv6/ipv6_sockglue.c:1026
 udpv6_setsockopt+0x76/0xc0 net/ipv6/udp.c:1652
 __sys_setsockopt+0x2d6/0x690 net/socket.c:2252
 __do_sys_setsockopt net/socket.c:2263 [inline]
 __se_sys_setsockopt net/socket.c:2260 [inline]
 __x64_sys_setsockopt+0xba/0x150 net/socket.c:2260
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fbfdc6eeb09
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffed2b8f58 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fbfdc6eeb09
RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000003
RBP: 00007fbfdc6b2cb0 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000020000300 R11: 0000000000000246 R12: 00007fbfdc6b2d40
R13: 000000

Crashes (196):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/08/30 19:33 linux-next 282342f2dc97 4a380809 .config strace log report syz C ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/18 07:10 upstream bbb8ceb5e242 754863b4 .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/18 05:23 upstream bbb8ceb5e242 754863b4 .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/18 03:15 upstream bbb8ceb5e242 754863b4 .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/17 19:53 upstream 9abf2313adc1 94744d21 .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/17 17:51 upstream 9abf2313adc1 94744d21 .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/17 13:39 upstream 9abf2313adc1 94744d21 .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/17 08:16 upstream 9abf2313adc1 67cb024c .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/17 01:43 upstream 2df76606db9d 67cb024c .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/17 00:39 upstream 2df76606db9d 67cb024c .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/16 23:17 upstream 2df76606db9d 67cb024c .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/16 20:13 upstream 2df76606db9d 67cb024c .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/16 19:07 upstream 2df76606db9d 67cb024c .config console log report info ci-qemu-upstream BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/18 02:00 upstream bbb8ceb5e242 754863b4 .config console log report info ci-qemu-upstream-386 BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/17 15:16 upstream 9abf2313adc1 94744d21 .config console log report info ci-qemu-upstream-386 BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/17 11:03 upstream 9abf2313adc1 67cb024c .config console log report info ci-qemu-upstream-386 BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/17 09:47 upstream 9abf2313adc1 67cb024c .config console log report info ci-qemu-upstream-386 BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/16 09:35 linux-next aaa11ce2ffc8 67cb024c .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/16 07:31 linux-next aaa11ce2ffc8 67cb024c .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/15 13:08 linux-next aaa11ce2ffc8 67cb024c .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/13 16:14 linux-next aaa11ce2ffc8 adf90437 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/11 06:51 linux-next aaa11ce2ffc8 2b253ced .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/11 03:17 linux-next aaa11ce2ffc8 2b253ced .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/10 17:37 linux-next aaa11ce2ffc8 aea5da89 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/10 05:08 linux-next aaa11ce2ffc8 aea5da89 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/09 22:44 linux-next aaa11ce2ffc8 aea5da89 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/09 11:29 linux-next aaa11ce2ffc8 aea5da89 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/08 14:59 linux-next aaa11ce2ffc8 aea5da89 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/08 12:09 linux-next aaa11ce2ffc8 aea5da89 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/08 02:30 linux-next aaa11ce2ffc8 0de35f24 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/07 21:54 linux-next aaa11ce2ffc8 0de35f24 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/07 18:53 linux-next aaa11ce2ffc8 0de35f24 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/07 13:32 linux-next aaa11ce2ffc8 8a212197 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/07 02:11 linux-next aaa11ce2ffc8 8a212197 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/07 00:20 linux-next aaa11ce2ffc8 8a212197 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/06 14:22 linux-next aaa11ce2ffc8 131b38ac .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/06 12:32 linux-next aaa11ce2ffc8 131b38ac .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/06 01:46 linux-next aaa11ce2ffc8 2c6543ad .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/05 23:12 linux-next aaa11ce2ffc8 2c6543ad .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/05 12:43 linux-next aaa11ce2ffc8 267e3bb1 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/05 10:30 linux-next aaa11ce2ffc8 267e3bb1 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/05 05:57 linux-next aaa11ce2ffc8 eab8f949 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/05 00:46 linux-next aaa11ce2ffc8 eab8f949 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/04 23:08 linux-next aaa11ce2ffc8 eab8f949 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/04 18:58 linux-next aaa11ce2ffc8 eab8f949 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/04 17:08 linux-next aaa11ce2ffc8 eab8f949 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/04 12:24 linux-next aaa11ce2ffc8 77d3f689 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/02 23:28 linux-next aaa11ce2ffc8 feb56351 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/02 19:32 linux-next aaa11ce2ffc8 feb56351 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/02 04:46 linux-next aaa11ce2ffc8 feb56351 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/10/02 00:16 linux-next aaa11ce2ffc8 feb56351 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/09/30 20:28 linux-next aaa11ce2ffc8 feb56351 .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
2022/08/30 13:18 linux-next 282342f2dc97 5b44472d .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in kernfs_walk_and_get_ns
* Struck through repros no longer work on HEAD.