syzbot


BUG: soft lockup in bpf_prog_release

Status: premoderation: reported on 2024/04/24 02:56
Reported-by: syzbot+911fd4763f0e83c94854@syzkaller.appspotmail.com
First crash: 11d, last: 11d

Sample crash report:
watchdog: BUG: soft lockup - CPU#0 stuck for 225s! [syz-executor.1:344]
Modules linked in:
CPU: 0 PID: 344 Comm: syz-executor.1 Not tainted 5.15.148-syzkaller-00013-gad06eaf051cd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
RIP: 0010:pv_wait_node kernel/locking/qspinlock_paravirt.h:301 [inline]
RIP: 0010:__pv_queued_spin_lock_slowpath+0x38b/0xc40 kernel/locking/qspinlock.c:473
Code: 00 00 00 00 00 fc ff df 41 0f b6 04 16 84 c0 0f 85 ac 00 00 00 48 8b 44 24 08 83 38 00 0f 85 15 01 00 00 45 84 e4 74 09 f3 90 <41> ff cc 75 d9 eb 1b 48 8b 44 24 20 0f b6 04 10 84 c0 0f 85 cd 00
RSP: 0018:ffffc90005327880 EFLAGS: 00000286
RAX: ffff8881f7037ec8 RBX: ffff8881f7037ed4 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffff8881f7037ed4
RBP: ffffc90005327970 R08: dffffc0000000000 R09: ffffed103ee06fdb
R10: 0000000000000000 R11: dffffc0000000001 R12: 00000000000057a9
R13: 1ffff1102199c44b R14: 1ffff1103ee06fd9 R15: ffff88810cce2258
FS:  000055555611e480(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2e623000 CR3: 000000010cdf2000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 </IRQ>
 <TASK>
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:585 [inline]
 queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:85 [inline]
 do_raw_spin_lock include/linux/spinlock.h:187 [inline]
 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline]
 _raw_spin_lock_bh+0x139/0x1b0 kernel/locking/spinlock.c:178
 sock_hash_delete_elem+0xb1/0x2f0 net/core/sock_map.c:937
 bpf_prog_6164f3e647ab800e+0x3d/0x238
 bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline]
 __bpf_prog_run include/linux/filter.h:625 [inline]
 bpf_prog_run include/linux/filter.h:632 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:1883 [inline]
 bpf_trace_run2+0xec/0x210 kernel/trace/bpf_trace.c:1920
 __bpf_trace_kfree+0x6f/0x90 include/trace/events/kmem.h:118
 trace_kfree include/trace/events/kmem.h:118 [inline]
 kfree+0x1f3/0x220 mm/slub.c:4569
 kvfree+0x35/0x40 mm/util.c:664
 __bpf_prog_put_noref+0xa1/0x2c0 kernel/bpf/syscall.c:1770
 bpf_prog_put_deferred+0x2ee/0x3e0 kernel/bpf/syscall.c:1796
 __bpf_prog_put kernel/bpf/syscall.c:1808 [inline]
 bpf_prog_put kernel/bpf/syscall.c:1815 [inline]
 bpf_prog_release+0x27d/0x290 kernel/bpf/syscall.c:1823
 __fput+0x3fe/0x910 fs/file_table.c:280
 ____fput+0x15/0x20 fs/file_table.c:308
 task_work_run+0x129/0x190 kernel/task_work.c:164
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0xc4/0xe0 kernel/entry/common.c:175
 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208
 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
 syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301
 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7ff765f96d9a
Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24
RSP: 002b:00007ffd59092200 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000005 RCX: 00007ff765f96d9a
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00007ff7660c7980 R08: 0000001b2ea20000 R09: 0000000000000351
R10: 00000000812e7ea3 R11: 0000000000000293 R12: 0000000000006e10
R13: 0000000000006b09 R14: 00007ffd590923c0 R15: 00007ff765f4ecb0
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 348 Comm: syz-executor.3 Not tainted 5.15.148-syzkaller-00013-gad06eaf051cd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
RIP: 0010:native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline]
RIP: 0010:arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline]
RIP: 0010:kvm_wait+0x147/0x180 arch/x86/kernel/kvm.c:918
Code: 4c 89 e8 48 c1 e8 03 42 0f b6 04 20 84 c0 44 8b 74 24 1c 75 34 41 0f b6 45 00 44 38 f0 75 10 66 90 0f 00 2d 5b 03 f3 03 fb f4 <e9> 24 ff ff ff fb e9 1e ff ff ff 44 89 e9 80 e1 07 38 c1 7c a3 4c
RSP: 0018:ffffc900053771a0 EFLAGS: 00000246
RAX: 0000000000000003 RBX: 1ffff92000a6ee38 RCX: ffffffff8154f88f
RDX: dffffc0000000000 RSI: 0000000000000003 RDI: ffff88810cce2258
RBP: ffffc90005377250 R08: dffffc0000000000 R09: ffffed102199c44c
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88810cce2258 R14: 0000000000000003 R15: 1ffff92000a6ee3c
FS:  00007fa2fe4dd6c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa2fe4dcf38 CR3: 0000000128434000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <TASK>
 pv_wait arch/x86/include/asm/paravirt.h:597 [inline]
 pv_wait_head_or_lock kernel/locking/qspinlock_paravirt.h:470 [inline]
 __pv_queued_spin_lock_slowpath+0x6bc/0xc40 kernel/locking/qspinlock.c:508
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:585 [inline]
 queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:85 [inline]
 do_raw_spin_lock include/linux/spinlock.h:187 [inline]
 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline]
 _raw_spin_lock_bh+0x139/0x1b0 kernel/locking/spinlock.c:178
 sock_hash_delete_elem+0xb1/0x2f0 net/core/sock_map.c:937
 bpf_prog_6164f3e647ab800e+0x3d/0x238
 bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline]
 __bpf_prog_run include/linux/filter.h:625 [inline]
 bpf_prog_run include/linux/filter.h:632 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:1883 [inline]
 bpf_trace_run2+0xec/0x210 kernel/trace/bpf_trace.c:1920
 __bpf_trace_kfree+0x6f/0x90 include/trace/events/kmem.h:118
 trace_kfree include/trace/events/kmem.h:118 [inline]
 kfree+0x1f3/0x220 mm/slub.c:4569
 sk_psock_free_link include/linux/skmsg.h:420 [inline]
 sock_map_del_link net/core/sock_map.c:160 [inline]
 sock_map_unref+0x352/0x4d0 net/core/sock_map.c:182
 sock_hash_delete_elem+0x274/0x2f0 net/core/sock_map.c:941
 bpf_prog_6164f3e647ab800e+0x3d/0x238
 bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline]
 __bpf_prog_run include/linux/filter.h:625 [inline]
 bpf_prog_run include/linux/filter.h:632 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:1883 [inline]
 bpf_trace_run2+0xec/0x210 kernel/trace/bpf_trace.c:1920
 __bpf_trace_kfree+0x6f/0x90 include/trace/events/kmem.h:118
 trace_kfree include/trace/events/kmem.h:118 [inline]
 kfree+0x1f3/0x220 mm/slub.c:4569
 context_destroy security/selinux/ss/context.h:177 [inline]
 security_compute_sid+0x1d7d/0x1f40 security/selinux/ss/services.c:1913
 security_transition_sid+0x7d/0x90 security/selinux/ss/services.c:1936
 inode_doinit_with_dentry+0x61b/0x1070 security/selinux/hooks.c:1529
 selinux_d_instantiate+0x27/0x40 security/selinux/hooks.c:6462
 security_d_instantiate+0x9f/0x100 security/security.c:2056
 d_instantiate+0x55/0x90 fs/dcache.c:2008
 alloc_file_pseudo+0x248/0x2f0 fs/file_table.c:231
 __shmem_file_setup+0x1d6/0x2a0 mm/shmem.c:4147
 shmem_file_setup+0x2f/0x40 mm/shmem.c:4177
 __do_sys_memfd_create mm/memfd.c:323 [inline]
 __se_sys_memfd_create+0x1e1/0x3e0 mm/memfd.c:266
 __x64_sys_memfd_create+0x5b/0x70 mm/memfd.c:266
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fa2ff769ea9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa2fe4dcea8 EFLAGS: 00000202 ORIG_RAX: 000000000000013f
RAX: ffffffffffffffda RBX: 0000000000000762 RCX: 00007fa2ff769ea9
RDX: 00007fa2fe4dcf80 RSI: 0000000000000000 RDI: 00007fa2ff7b5722
RBP: 0000000020001180 R08: 00007fa2fe4dcc47 R09: 0000000000000000
R10: 000000000000000a R11: 0000000000000202 R12: 00000000200000c0
R13: 00007fa2fe4dcf80 R14: 00007fa2fe4dcf40 R15: 0000000020004080
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/24 02:55 android13-5.15-lts ad06eaf051cd 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 BUG: soft lockup in bpf_prog_release
* Struck through repros no longer work on HEAD.