panic: kernel diagnostic assertion "__mp_lock_held(&sched_lock, curcpu()) == 0" failed: file "/syzkaller/managers/setuid

0 views
Skip to first unread message

syzbot

unread,
Dec 9, 2018, 3:16:03 AM12/9/18
to syzkaller-o...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 737f2a163501 anton@: Do not trace before kcovopen() has be..
git tree: https://github.com/blackgnezdo/src.git anton-kcov-dec8
console output: https://syzkaller.appspot.com/x/log.txt?x=135bb3d5400000
kernel config: https://syzkaller.appspot.com/x/.config?x=f2ee3db928411249
dashboard link: https://syzkaller.appspot.com/bug?extid=1d90c98d5db46df27051
compiler:

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+1d90c9...@syzkaller.appspotmail.com

panic: kernel diagnostic assertion "__mp_lock_held(&sched_lock, curcpu())
== 0" failed:
file "/syzkaller/managers/setuid/kernel/sys/kern/kern_lock.c", line 63
Stopped at db_enter+0xa: popq %rbp
TID PID UID PRFLAGS PFLAGS CPU COMMAND
db_enter() at db_enter+0xa sys/arch/amd64/amd64/db_interface.c:399
panic() at panic+0x147 sys/kern/subr_prf.c:208
__assert(ffffffff818e4124,ffff800021195100,ffff8000210a2bd0,ffff800000038e80)
at
__assert+0x24 sys/kern/subr_prf.c:155
_kernel_lock(ffff8000210a2bd0,ffff800021190000) at _kernel_lock+0x125
sys/kern/kern_lock.c:63
pageflttrap() at pageflttrap+0x6c sys/arch/amd64/amd64/trap.c:163
kerntrap(9) at kerntrap+0x8d sys/arch/amd64/amd64/trap.c:294
alltraps_kern(6,ffff8000012d6000,ffffffffffffffff,0,9,ffff8000210a2bd0) at
alltraps_kern+0x7b
ptsignal(2ad7,ffff8000210a2bd0,ffff8000210b7c80) at ptsignal+0x115
sys/kern/kern_sig.c:944
mi_switch() at mi_switch+0x1fb sys/kern/sched_bsd.c:392
sleep_finish(1,ffff800021195390) at sleep_finish+0xd3
sys/kern/kern_synch.c:312
sleep_finish_all(ffff800021195390,32) at sleep_finish_all+0x22
sleep_finish_timeout sys/kern/kern_synch.c:336 [inline]
sleep_finish_all(ffff800021195390,32) at sleep_finish_all+0x22
sys/kern/kern_synch.c:157
tsleep(ffff8000210a2bd0,3,0,ffff8000210b7d48) at tsleep+0x142
single_thread_set(ffff8000210a2bd0,ffff8000210a2bd0,0) at
single_thread_set+0x28b single_thread_wait sys/kern/kern_sig.c:2051 [inline]
single_thread_set(ffff8000210a2bd0,ffff8000210a2bd0,0) at
single_thread_set+0x28b sys/kern/kern_sig.c:2042
exit1(ffff8000210a2bd0,9,0) at exit1+0x84 sys/kern/kern_exit.c:137
end trace frame: 0xffff800021195560, count: 0
https://www.openbsd.org/ddb.html describes the minimum info required in bug
reports. Insufficient info makes it difficult to find and fix bugs.
ddb{1}>
ddb{1}> set $lines = 0
ddb{1}> show panic
kernel diagnostic assertion "__mp_lock_held(&sched_lock, curcpu()) == 0"
failed: file "/syzkaller/managers/setuid/kernel/sys/kern/kern_lock.c", line
63
ddb{1}> trace
db_enter() at db_enter+0xa sys/arch/amd64/amd64/db_interface.c:399
panic() at panic+0x147 sys/kern/subr_prf.c:208
__assert(ffffffff818e4124,ffff800021195100,ffff8000210a2bd0,ffff800000038e80)
at
__assert+0x24 sys/kern/subr_prf.c:155
_kernel_lock(ffff8000210a2bd0,ffff800021190000) at _kernel_lock+0x125
sys/kern/kern_lock.c:63
pageflttrap() at pageflttrap+0x6c sys/arch/amd64/amd64/trap.c:163
kerntrap(9) at kerntrap+0x8d sys/arch/amd64/amd64/trap.c:294
alltraps_kern(6,ffff8000012d6000,ffffffffffffffff,0,9,ffff8000210a2bd0) at
alltraps_kern+0x7b
ptsignal(2ad7,ffff8000210a2bd0,ffff8000210b7c80) at ptsignal+0x115
sys/kern/kern_sig.c:944
mi_switch() at mi_switch+0x1fb sys/kern/sched_bsd.c:392
sleep_finish(1,ffff800021195390) at sleep_finish+0xd3
sys/kern/kern_synch.c:312
sleep_finish_all(ffff800021195390,32) at sleep_finish_all+0x22
sleep_finish_timeout sys/kern/kern_synch.c:336 [inline]
sleep_finish_all(ffff800021195390,32) at sleep_finish_all+0x22
sys/kern/kern_synch.c:157
tsleep(ffff8000210a2bd0,3,0,ffff8000210b7d48) at tsleep+0x142
single_thread_set(ffff8000210a2bd0,ffff8000210a2bd0,0) at
single_thread_set+0x28b single_thread_wait sys/kern/kern_sig.c:2051 [inline]
single_thread_set(ffff8000210a2bd0,ffff8000210a2bd0,0) at
single_thread_set+0x28b sys/kern/kern_sig.c:2042
exit1(ffff8000210a2bd0,9,0) at exit1+0x84 sys/kern/kern_exit.c:137
postsig(100,ffff8000210a2bd0) at postsig+0x3ea sigexit
sys/kern/kern_sig.c:1500 [inline]
postsig(100,ffff8000210a2bd0) at postsig+0x3ea sys/kern/kern_sig.c:1432
userret(0) at userret+0x11b sys/kern/kern_sig.c:1882
syscall(0) at syscall+0x54d mi_syscall_return sys/sys/syscall_mi.h:122
[inline]
syscall(0) at syscall+0x54d sys/arch/amd64/amd64/trap.c:605
Xsyscall(6,58,9b35f792e00,53,0,9b35f78a120) at Xsyscall+0x128
end of kernel
end trace frame: 0x9b3f91573d0, count: -18
ddb{1}> show registers
rdi 0xffffffff81e337f8 kprintf_mutex
rsi 0xffffffff81696879 db_enter+0x9
rbp 0xffff800021195060
rbx 0xffff800021195100
rdx 0xffff8000012d6000
rcx 0x4365 __ALIGN_SIZE+0x3365
rax 0xffff8000012d6000
r8 0xffff800021195030
r9 0x8080808080808080
r10 0x2f4d9a4f53f45392
r11 0xffffffff8181f470 x86_bus_space_io_read_1
r12 0x3000000008
r13 0xffff800021195070
r14 0x100
r15 0xffffffff81bf4e1e cmd0646_9_tim_udma+0x1f12c
rip 0xffffffff8169687a db_enter+0xa
cs 0x8
rflags 0x206
rsp 0xffff800021195060
ss 0x10
db_enter+0xa: popq %rbp
ddb{1}> show proc
PROC (syz-executor0) pid=129412 stat=sleep
flags process=1010<SUGID,SINGLEEXIT> proc=4002000<WEXIT,THREAD>
pri=50, usrpri=86, nice=20
forw=0x0, list=0xffff8000210a3788,0xffffffff81eb7cb0
process=0xffff8000210b7c80 user=0xffff800021190000,
vmspace=0xffffff0065b44218
estcpu=36, cpticks=0, pctcpu=0.0
user=0, sys=0, intr=0
ddb{1}> ps
PID TID PPID UID S FLAGS WAIT COMMAND
89569 495286 22088 65534 2 0x10 syz-executor1
89569 490884 22088 65534 3 0x4000010 biowait syz-executor1
29314 368648 73783 65534 2 0x4081090 syz-executor0
*29314 129412 73783 65534 3 0x4003010 suspend syz-executor0
73783 340175 91609 65534 3 0x90 nanosleep syz-executor0
91609 34100 11668 0 3 0x82 wait syz-executor0
22088 96562 99615 65534 3 0x90 nanosleep syz-executor1
99615 119208 11668 0 3 0x82 wait syz-executor1
56369 396918 0 0 3 0x14200 bored sosplice
11668 232044 24130 0 3 0x82 thrsleep syz-fuzzer
11668 473878 24130 0 3 0x4000082 nanosleep syz-fuzzer
11668 163579 24130 0 3 0x4000082 thrsleep syz-fuzzer
11668 162965 24130 0 3 0x4000082 thrsleep syz-fuzzer
11668 206450 24130 0 3 0x4000082 thrsleep syz-fuzzer
11668 177793 24130 0 3 0x4000082 thrsleep syz-fuzzer
11668 89396 24130 0 3 0x4000082 thrsleep syz-fuzzer
11668 140038 24130 0 3 0x4000082 kqread syz-fuzzer
11668 205861 24130 0 3 0x4000082 thrsleep syz-fuzzer
11668 169042 24130 0 3 0x4000082 thrsleep syz-fuzzer
24130 465676 86435 0 3 0x10008a pause ksh
86435 121707 35644 0 3 0x92 select sshd
37851 428331 1 0 3 0x100083 ttyin getty
35644 95552 1 0 3 0x80 select sshd
99954 322634 19771 73 3 0x100090 kqread syslogd
19771 39107 1 0 3 0x100082 netio syslogd
60411 134578 1 77 3 0x100090 poll dhclient
21997 347033 1 0 3 0x80 poll dhclient
58094 421103 0 0 2 0x14200 zerothread
78879 54068 0 0 3 0x14200 aiodoned aiodoned
15990 337320 0 0 3 0x14200 syncer update
50449 25705 0 0 3 0x14200 cleaner cleaner
26041 214232 0 0 3 0x14200 reaper reaper
13064 81087 0 0 3 0x14200 pgdaemon pagedaemon
48197 478893 0 0 3 0x14200 bored crynlk
23910 301710 0 0 3 0x14200 bored crypto
54426 464120 0 0 3 0x40014200 acpi0 acpi0
25241 132489 0 0 3 0x40014200 idle1
4976 275881 0 0 3 0x14200 bored softnet
9458 477404 0 0 3 0x14200 bored systqmp
99508 375635 0 0 3 0x14200 bored systq
73165 14544 0 0 3 0x40014200 bored softclock
38014 508816 0 0 3 0x40014200 idle0
1 125227 0 0 3 0x82 wait init
0 0 -1 0 3 0x10200 scheduler swapper


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
syzbot.

Dmitry Vyukov

unread,
Dec 9, 2018, 4:56:18 AM12/9/18
to syzbot+1d90c9...@syzkaller.appspotmail.com, syzkaller-o...@googlegroups.com, Greg Steuck, Anton Lindqvist
/\/\/\/\/\/\/\/\

Yay line numbers!
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-openbsd-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-openbsd...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-openbsd-bugs/00000000000091bb98057c9275da%40google.com.
> For more options, visit https://groups.google.com/d/optout.

syzbot

unread,
Dec 12, 2018, 8:15:04 PM12/12/18
to an...@basename.se, dvy...@google.com, gne...@google.com, syzkaller-o...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: 918267856206 document show-indexed
git tree: https://github.com/openbsd/src.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=17e107a3400000
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14f46ff5400000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=162e4593400000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+1d90c9...@syzkaller.appspotmail.com

panic: kernel diagnostic assertion "__mp_lock_held(&sched_lock, curcpu())
== 0" failed:
file "/syzkaller/managers/setuid/kernel/sys/kern/kern_lock.c", line 63
Stopped at db_enter+0xa: popq %rbp
TID PID UID PRFLAGS PFLAGS CPU COMMAND
db_enter() at db_enter+0xa sys/arch/amd64/amd64/db_interface.c:399
panic() at panic+0x147 sys/kern/subr_prf.c:208
__assert(ffffffff8172be34,ffff80002112b430,ffff800021085778,ffff80000002f180)
at
__assert+0x24 sys/kern/subr_prf.c:155
_kernel_lock(ffff800021085778,ffff800021126000) at _kernel_lock+0x125
sys/kern/kern_lock.c:63
pageflttrap() at pageflttrap+0x6c sys/arch/amd64/amd64/trap.c:163
kerntrap(9) at kerntrap+0x8d sys/arch/amd64/amd64/trap.c:294
alltraps_kern(6,82000,ffffffffffffffff,0,9,ffff800021085778) at
alltraps_kern+0x7b
ptsignal(17ae,ffff800021085778,ffff800021071620) at ptsignal+0x115
sys/kern/kern_sig.c:944
mi_switch() at mi_switch+0x1fb sys/kern/sched_bsd.c:392
sleep_finish(1,ffff80002112b6c0) at sleep_finish+0xd3
sys/kern/kern_synch.c:312
sleep_finish_all(ffff80002112b6c0,32) at sleep_finish_all+0x22
sleep_finish_timeout sys/kern/kern_synch.c:336 [inline]
sleep_finish_all(ffff80002112b6c0,32) at sleep_finish_all+0x22
sys/kern/kern_synch.c:157
tsleep(ffff800021085778,3,0,ffff8000210716e8) at tsleep+0x142
single_thread_set(ffff800021085778,ffff800021085778,0) at
single_thread_set+0x28b single_thread_wait sys/kern/kern_sig.c:2051 [inline]
single_thread_set(ffff800021085778,ffff800021085778,0) at
single_thread_set+0x28b sys/kern/kern_sig.c:2042
exit1(ffff800021085778,9,0) at exit1+0x84 sys/kern/kern_exit.c:137
end trace frame: 0xffff80002112b890, count: 0
https://www.openbsd.org/ddb.html describes the minimum info required in bug
reports. Insufficient info makes it difficult to find and fix bugs.
ddb{0}>
ddb{0}> set $lines = 0
ddb{0}> show panic
kernel diagnostic assertion "__mp_lock_held(&sched_lock, curcpu()) == 0"
failed: file "/syzkaller/managers/setuid/kernel/sys/kern/kern_lock.c", line
63
ddb{0}> trace
db_enter() at db_enter+0xa sys/arch/amd64/amd64/db_interface.c:399
panic() at panic+0x147 sys/kern/subr_prf.c:208
__assert(ffffffff8172be34,ffff80002112b430,ffff800021085778,ffff80000002f180)
at
__assert+0x24 sys/kern/subr_prf.c:155
_kernel_lock(ffff800021085778,ffff800021126000) at _kernel_lock+0x125
sys/kern/kern_lock.c:63
pageflttrap() at pageflttrap+0x6c sys/arch/amd64/amd64/trap.c:163
kerntrap(9) at kerntrap+0x8d sys/arch/amd64/amd64/trap.c:294
alltraps_kern(6,82000,ffffffffffffffff,0,9,ffff800021085778) at
alltraps_kern+0x7b
ptsignal(17ae,ffff800021085778,ffff800021071620) at ptsignal+0x115
sys/kern/kern_sig.c:944
mi_switch() at mi_switch+0x1fb sys/kern/sched_bsd.c:392
sleep_finish(1,ffff80002112b6c0) at sleep_finish+0xd3
sys/kern/kern_synch.c:312
sleep_finish_all(ffff80002112b6c0,32) at sleep_finish_all+0x22
sleep_finish_timeout sys/kern/kern_synch.c:336 [inline]
sleep_finish_all(ffff80002112b6c0,32) at sleep_finish_all+0x22
sys/kern/kern_synch.c:157
tsleep(ffff800021085778,3,0,ffff8000210716e8) at tsleep+0x142
single_thread_set(ffff800021085778,ffff800021085778,0) at
single_thread_set+0x28b single_thread_wait sys/kern/kern_sig.c:2051 [inline]
single_thread_set(ffff800021085778,ffff800021085778,0) at
single_thread_set+0x28b sys/kern/kern_sig.c:2042
exit1(ffff800021085778,9,0) at exit1+0x84 sys/kern/kern_exit.c:137
postsig(100,ffff800021085778) at postsig+0x3ea sigexit
sys/kern/kern_sig.c:1500 [inline]
postsig(100,ffff800021085778) at postsig+0x3ea sys/kern/kern_sig.c:1432
userret(0) at userret+0x11b sys/kern/kern_sig.c:1882
syscall(0) at syscall+0x54d mi_syscall_return sys/sys/syscall_mi.h:122
[inline]
syscall(0) at syscall+0x54d sys/arch/amd64/amd64/trap.c:605
Xsyscall(6,58,3ceb4e87a00,53,0,3cecb9d9a40) at Xsyscall+0x128
end of kernel
end trace frame: 0x3cf36212fb0, count: -18
ddb{0}> show registers
rdi 0xffffffff81e3d210 kprintf_mutex
rsi 0x5
rbp 0xffff80002112b390
rbx 0xffff80002112b430
rdx 0x3fd
rcx 0
rax 0x1
r8 0xffff80002112b360
r9 0x8080808080808080
r10 0
r11 0xffffffff816984e0 x86_bus_space_io_read_1
r12 0x3000000008
r13 0xffff80002112b3a0
r14 0x100
r15 0xffffffff81bf66f0 cmd0646_9_tim_udma+0x1ebfb
rip 0xffffffff8188a89a db_enter+0xa
cs 0x8
rflags 0x202
rsp 0xffff80002112b390
ss 0x10
db_enter+0xa: popq %rbp
ddb{0}> show proc
PROC (syz-executor5550) pid=119238 stat=sleep
flags process=1000<SINGLEEXIT> proc=4002000<WEXIT,THREAD>
pri=50, usrpri=50, nice=20
forw=0x0, list=0xffff8000210852c8,0xffff800021084978
process=0xffff800021071620 user=0xffff800021126000,
vmspace=0xffffff007f125528
estcpu=36, cpticks=0, pctcpu=0.0
user=0, sys=0, intr=0
ddb{0}> ps
PID TID PPID UID S FLAGS WAIT COMMAND
*15395 119238 28346 0 3 0x4003000 suspend syz-executor5550
15395 417257 28346 0 2 0x4081000 syz-executor5550
28346 284878 94619 0 3 0x80 nanosleep syz-executor5550
60014 217522 94619 0 3 0x80 nanosleep syz-executor5550
94619 71961 32712 0 3 0x82 nanosleep syz-executor5550
32712 564 76317 0 3 0x10008a pause ksh
76317 67270 53563 0 3 0x92 select sshd
61787 344689 1 0 3 0x100083 ttyin getty
53563 340940 1 0 3 0x80 select sshd
96462 163327 62857 73 3 0x100090 kqread syslogd
62857 51166 1 0 3 0x100082 netio syslogd
82747 423381 1 77 3 0x100090 poll dhclient
61770 477583 1 0 3 0x80 poll dhclient
44288 141028 0 0 2 0x14200 zerothread
2949 95657 0 0 3 0x14200 aiodoned aiodoned
59569 2744 0 0 3 0x14200 syncer update
97615 18787 0 0 3 0x14200 cleaner cleaner
31075 516634 0 0 3 0x14200 reaper reaper
92050 406702 0 0 3 0x14200 pgdaemon pagedaemon
57938 307153 0 0 3 0x14200 bored crynlk
35754 9636 0 0 3 0x14200 bored crypto
28435 50474 0 0 3 0x40014200 acpi0 acpi0
27223 311074 0 0 3 0x40014200 idle1
51849 92683 0 0 3 0x14200 bored softnet
87709 391602 0 0 3 0x14200 bored systqmp
36507 388915 0 0 3 0x14200 bored systq
6364 371912 0 0 3 0x40014200 bored softclock
91853 126411 0 0 3 0x40014200 idle0
1 71431 0 0 3 0x82 wait init
0 0 -1 0 3 0x10200 scheduler swapper
ddb{0}>

Anton Lindqvist

unread,
Dec 25, 2018, 6:10:12 AM12/25/18
to syzbot, syzkaller-o...@googlegroups.com
#syz dup: assert "__mp_lock_held(&sched_lock, curcpu()) == 0" failed in kern_lock.c
Reply all
Reply to author
Forward
0 new messages