syzbot


assert failed: so->so_lock == NULL

Status: fixed on 2019/02/26 22:17
Reported-by: syzbot+901e2e5edaaaed21c069@syzkaller.appspotmail.com
Fix commit: 516d295318eb Fix locking: it is fine if the lock is already key_so_mtx, this can happen in socketpair. In that case don't take it.
First crash: 1898d, last: 1897d

Sample crash report:
[  38.0137504] panic: kernel diagnostic assertion "so->so_lock == NULL" failed: file "/syzkaller/managers/netbsd/kernel/sys/netipsec/keysock.c", line 386 
[  38.0137504] cpu0: Begin traceback...
[  38.0254484] vpanic() at netbsd:vpanic+0x214
[  38.0254484] _GLOBAL__sub_D_65535_0_cpu_configure() at netbsd:_GLOBAL__sub_D_65535_0_cpu_configure
[  38.0360117] key_attach_wrapper() at netbsd:key_attach_wrapper+0x2b5
[  38.0360117] socreate() at netbsd:socreate+0x218
[  38.0471423] makesocket() at netbsd:makesocket+0x80
[  38.0582698] sys_socketpair() at netbsd:sys_socketpair+0x1d1
[  38.0582698] sys_syscall() at netbsd:sys_syscall+0xe2
[  38.0718770] syscall() at netbsd:syscall+0x30e
[  38.0808905] --- syscall (number 0) ---
[  38.0808905] 78a435c3f4ca:
[  38.0923475] cpu0: End traceback...

[  38.0923475] dumping to dev 4,1 (offset=0, size=0): not possible
[  38.0923475] rebooting...
SeaBIOS (version 1.8.2-20190204_181744-google)
Total RAM Size = 0x00000001e0000000 = 7680 MiB
CPUs found: 2     Max CPUs supported: 2
found virtio-scsi at 0:3
virtio-scsi vendor='Google' product='PersistentDisk' rev='1' type=0 removable=0
virtio-scsi blksize=512 sectors=4194304 = 2048 MiB
drive 0x000f2a00: PCHS=0/0/0 translation=lba LCHS=520/128/63 s=4194304
Booting from Hard Disk 0...

>> NetBSD/x86 BIOS Boot, Revision 5.10 (Tue Jul 17 14:59:51 UTC 2018) (from NetBSD 8.0)
>> Memory: 639/3144640 k

     1. Boot normally
     2. Boot single user
     3. Disable ACPI
     4. Disable ACPI and SMP
     5. Drop to boot prompt
|/-\|/-39065424\|/-\|/-\|/-\|/-\|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/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-+2877616\|/- [1062168\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/+1363032-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/+1044595-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-]=0x2b4fbd8
\|/-\|/-\|/-\|/-\|/-\|/-\|/-WARNING: couldn't open /var/db/entropy-file
WARNING: 1 module failed to load

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/02/26 10:01 netbsd ed61d1fdd6fd 8022bafd console log report syz C ci2-netbsd
2019/02/25 13:29 netbsd 92d3cba1c669 a70141bf console log report syz C ci2-netbsd
2019/02/26 17:27 netbsd ed61d1fdd6fd a36ecd98 console log report ci2-netbsd
2019/02/25 22:50 netbsd 5eba7b0ad839 8022bafd console log report ci2-netbsd
2019/02/25 13:18 netbsd 92d3cba1c669 a70141bf console log report ci2-netbsd
* Struck through repros no longer work on HEAD.