syzbot


ASan: Unauthorized Access in pg_delete

Status: closed as dup on 2020/05/03 06:53
Reported-by: syzbot+641af4ebfef7e1941b87@syzkaller.appspotmail.com
First crash: 1514d, last: 1514d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
assert failed: pgrp->pg_jobc > 0 C 1621 1266d 1466d

Sample crash report:
[ 316.9222021] panic: ASan: Unauthorized Access In 0xffffffff81195054: Addr 0xffff978014c46c58 [8 bytes, read, PoolUseAfterFree]

[ 316.9321894] cpu1: Begin traceback...
[ 316.9522343] vpanic() at netbsd:vpanic+0x244 sys/kern/subr_prf.c:336
[ 316.9822984] snprintf() at netbsd:snprintf
[ 317.0223617] kasan_report() at netbsd:kasan_report+0x98 kasan_code_name sys/kern/subr_asan.c:186 [inline]
[ 317.0223617] kasan_report() at netbsd:kasan_report+0x98 sys/kern/subr_asan.c:196
[ 317.0624366] __asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_4byte_isvalid sys/kern/subr_asan.c:346 [inline]
[ 317.0624366] __asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_8byte_isvalid sys/kern/subr_asan.c:360 [inline]
[ 317.0624366] __asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_check sys/kern/subr_asan.c:412 [inline]
[ 317.0624366] __asan_load8() at netbsd:__asan_load8+0x294 sys/kern/subr_asan.c:1182
[ 317.1025179] pg_delete() at netbsd:pg_delete+0xd1 sys/kern/kern_proc.c:1136
[ 317.1425897] proc_leavepgrp() at netbsd:proc_leavepgrp+0x1bb sys/kern/kern_proc.c:1072
[ 317.1826657] do_sys_waitid() at netbsd:do_sys_waitid+0x1116 proc_free sys/kern/kern_exit.c:1220 [inline]
[ 317.1826657] do_sys_waitid() at netbsd:do_sys_waitid+0x1116 sys/kern/kern_exit.c:676
[ 317.2127228] do_sys_wait() at netbsd:do_sys_wait+0x1c3 sys/kern/kern_exit.c:711
[ 317.2528003] sys___wait450() at netbsd:sys___wait450+0x10e sys/kern/kern_exit.c:731
[ 317.2928733] syscall() at netbsd:syscall+0x57e sy_call sys/sys/syscallvar.h:65 [inline]
[ 317.2928733] syscall() at netbsd:syscall+0x57e sy_invoke sys/sys/syscallvar.h:94 [inline]
[ 317.2928733] syscall() at netbsd:syscall+0x57e sys/arch/x86/x86/syscall.c:138
[ 317.3129126] --- syscall (number 449) ---
[ 317.3229326] 71e99524279a:
[ 317.3329796] cpu1: End traceback...
[ 317.3329796] fatal breakpoint trap in supervisor mode
[ 317.3429654] trap type 1 code 0 rip 0xffffffff8021e4b5 cs 0x8 rflags 0x246 cr2 0x71e9961067c0 ilevel 0x8 rsp 0xffff97817f07a6c0
[ 317.3529912] curlwp 0xffff978012c32540 pid 1.1 lowest kstack 0xffff97817f0732c0
Stopped in pid 1.1 (init) at    netbsd:breakpoint+0x5:  leave
?
breakpoint() at netbsd:breakpoint+0x5
db_panic() at netbsd:db_panic+0xe9 sys/ddb/db_panic.c:67
vpanic() at netbsd:vpanic+0x244 sys/kern/subr_prf.c:336
snprintf() at netbsd:snprintf
kasan_report() at netbsd:kasan_report+0x98 kasan_code_name sys/kern/subr_asan.c:186 [inline]
kasan_report() at netbsd:kasan_report+0x98 sys/kern/subr_asan.c:196
__asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_4byte_isvalid sys/kern/subr_asan.c:346 [inline]
__asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_8byte_isvalid sys/kern/subr_asan.c:360 [inline]
__asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_check sys/kern/subr_asan.c:412 [inline]
__asan_load8() at netbsd:__asan_load8+0x294 sys/kern/subr_asan.c:1182
pg_delete() at netbsd:pg_delete+0xd1 sys/kern/kern_proc.c:1136
proc_leavepgrp() at netbsd:proc_leavepgrp+0x1bb sys/kern/kern_proc.c:1072
do_sys_waitid() at netbsd:do_sys_waitid+0x1116 proc_free sys/kern/kern_exit.c:1220 [inline]
do_sys_waitid() at netbsd:do_sys_waitid+0x1116 sys/kern/kern_exit.c:676
do_sys_wait() at netbsd:do_sys_wait+0x1c3 sys/kern/kern_exit.c:711
sys___wait450() at netbsd:sys___wait450+0x10e sys/kern/kern_exit.c:731
syscall() at netbsd:syscall+0x57e sy_call sys/sys/syscallvar.h:65 [inline]
syscall() at netbsd:syscall+0x57e sy_invoke sys/sys/syscallvar.h:94 [inline]
syscall() at netbsd:syscall+0x57e sys/arch/x86/x86/syscall.c:138
--- syscall (number 449) ---
71e99524279a:
ds          a6a0
es          caf2
fs          a6a0
gs          a6f0
rdi         ffff97800e730480
rsi         ffff978012c327f8
rbp         ffff97817f07a6c0
rbx         ffff97816e695000
rdx         2
rcx         ffffffff80d1d399    db_panic+0xd5
rax         0
r8          4
r9          1ffffffff0554d04
r10         ffffffff82aa6823    db_onpanic+0x3
r11         8000000000
r12         ffff97816e6a6000
r13         ffffffff82417828    ostype+0x4e4e8
r14         ffff97817f07a750
r15         ffff97816e695068
rip         ffffffff8021e4b5    breakpoint+0x5
cs          8
rflags      246
rsp         ffff97817f07a6c0
ss          10
netbsd:breakpoint+0x5:  leave
PID    LID S CPU     FLAGS       STRUCT LWP *               NAME WAIT
669      1 2   0         0   ffff978012d8e280                 sh
598      1 2   0         0   ffff978013a98980               halt
548      1 2   0     40000   ffff9780139d06c0               sshd
195      1 2   0         0   ffff9780139d0b00            syslogd
268      1 2   0         0   ffff978012f75340             dhcpcd
222      1 3   1        80   ffff978012e7e8c0             dhcpcd wait
1    >   1 7   1         0   ffff978012c32540               init
0       29 3   0       204   ffff978012c88140            physiod physiod
0       48 3   0       204   ffff978012c8a180          pooldrain pooldrain
0       47 2   0       200   ffff978012c889c0            ioflush
0       46 3   1       200   ffff978012c88580           pgdaemon pgdaemon
0       44 3   1       200   ffff978012c32980            npfgc-0 npfgccv
0       43 3   1       204   ffff978012c32100            rt_free rt_free
0       42 3   1       204   ffff978012c28940              unpgc unpgc
0       41 3   0       204   ffff978012c28500    key_timehandler key_timehandler
0       40 3   1       204   ffff978012c280c0    icmp6_wqinput/1 icmp6_wqinput
0       39 3   0       204   ffff978012c1f900    icmp6_wqinput/0 icmp6_wqinput
0       38 3   0       204   ffff978012c1f4c0          nd6_timer nd6_timer
0       37 3   1       204   ffff978012c1f080    carp6_wqinput/1 carp6_wqinput
0       36 3   0       204   ffff978012c1a8c0    carp6_wqinput/0 carp6_wqinput
0       35 3   1       204   ffff978012c1a480     carp_wqinput/1 carp_wqinput
0       34 3   0       204   ffff978012c1a040     carp_wqinput/0 carp_wqinput
0       33 3   1       204   ffff978012a9fbc0     icmp_wqinput/1 icmp_wqinput
0       32 3   0       204   ffff978012a9f780     icmp_wqinput/0 icmp_wqinput
0       31 3   0       204   ffff978012a9f340           rt_timer rt_timer
0       30 3   0       204   ffff978012a90b80        vmem_rehash vmem_rehash
0       28 3   0       204   ffff978010160ac0           scsibus0 sccomp
0       27 3   0       200   ffff978010160680               pms0 pmsreset
0       26 3   1       204   ffff978010160240            xcall/1 xcall
0       25 1   1       200   ffff97801015fa80          softser/1
0       24 1   1       200   ffff97801015f640          softclk/1
0       23 1   1       200   ffff97801015f200          softbio/1
0       22 1   1       200   ffff978010071a40          softnet/1
0       21 1   1       201   ffff978010071600             idle/1
0       20 3   0       204   ffff9780100711c0           lnxpwrwq lnxpwrwq
0       19 3   0       204   ffff97801006fa00           lnxlngwq lnxlngwq
0       18 3   0       204   ffff97801006f5c0           lnxsyswq lnxsyswq
0       17 3   0       204   ffff97801006f180           lnxrcugc lnxrcugc
0       16 3   0       204   ffff97800ec529c0             sysmon smtaskq
0       15 3   0       204   ffff97800ec52580         pmfsuspend pmfsuspend
0       14 3   0       204   ffff97800ec52140           pmfevent pmfevent
0       13 3   0       204   ffff97800ec43980         sopendfree sopendfr
0       12 3   1       204   ffff97800ec43540            iflnkst iflnkst
0       11 3   0       204   ffff97800ec43100           nfssilly nfssilly
0    >  10 7   0       200   ffff97800ec37940            cachegc
0        9 3   0       204   ffff97800ec37500             vdrain vdrain
0        8 3   1       200   ffff97800ec370c0          modunload mod_unld
0        7 3   0       204   ffff97800ec27900            xcall/0 xcall
0        6 1   0       200   ffff97800ec274c0          softser/0
0        5 1   0       200   ffff97800ec27080          softclk/0
0        4 1   0       200   ffff97800ec248c0          softbio/0
0        3 1   0       200   ffff97800ec24480          softnet/0
0        2 1   0       201   ffff97800ec24040             idle/0
0        1 2   0       200   ffffffff82b6f840            swapper
[Locks tracked through LWPs]

****** LWP 669.1 (sh) @ 0xffff978012d8e280, l_stat=2

*** Locks held:

* Lock 0 (initialized at amap_ctor)
lock address : 0xffff97801451e080 type     :     sleep/adaptive
initialized  : 0xffffffff810ea333
shared holds :                  0 exclusive:                  1
shares wanted:                  0 exclusive:                  0
relevant cpu :                  0 last held:                  0
relevant lwp : 0xffff978012d8e280 last held: 0xffff978012d8e280
last locked* : 0xffffffff810f919d unlocked : 000000000000000000
owner/count  : 0xffff978012d8e280 flags    : 0x0000000000000004
Turnstile: no active turnstile for this lock.

* Lock 1 (initialized at pmap_ctor)
lock address : 0xffff978014372380 type     :     sleep/adaptive
initialized  : 0xffffffff80277669
shared holds :                  0 exclusive:                  1
shares wanted:                  0 exclusive:                  0
relevant cpu :                  0 last held:                  0
relevant lwp : 0xffff978012d8e280 last held: 0xffff978012d8e280
last locked* : 0xffffffff8027982c unlocked : 0xffffffff802772da
owner field  : 0xffff978012d8e280 wait/spin:                0/0
Turnstile: no active turnstile for this lock.

*** Locks wanted: none

****** LWP 548.1 (sshd) @ 0xffff9780139d06c0, l_stat=2

*** Locks held:

* Lock 0 (initialized at uvm_map_setup)
lock address : 0xffff9780139bb4b8 type     :     sleep/adaptive
initialized  : 0xffffffff8110a507
shared holds :                  0 exclusive:                  1
shares wanted:                  0 exclusive:                  0
relevant cpu :                  0 last held:                  0
relevant lwp : 0xffff9780139d06c0 last held: 0xffff9780139d06c0
last locked* : 0xffffffff81104564 unlocked : 0xffffffff810f70cf
owner/count  : 0xffff9780139d06c0 flags    : 0x0000000000000004
Turnstile: no active turnstile for this lock.

*** Locks wanted:

* Lock 0 (initialized at amap_ctor)
lock address : 0xffff9780145c7280 type     :     sleep/adaptive
initialized  : 0xffffffff810ea333
shared holds :                  0 exclusive:                  0
shares wanted:                  0 exclusive:                  1
relevant cpu :                  0 last held:                  0
relevant lwp : 0xffff9780139d06c0 last held: 000000000000000000
last locked  : 0xffffffff810f919d unlocked*: 0xffffffff810f70b0
[ 317.3630061] Skipping crash dump on recursive panic
[ 317.3630061] panic: ASan: Unauthorized Access In 0xffffffff811ad890: Addr 0xffff9780145c7280 [8 bytes, read, PoolUseAfterFree]

[ 317.3630061] cpu1: Begin traceback...
[ 317.3630061] vpanic() at netbsd:vpanic+0x244 sys/kern/subr_prf.c:336
[ 317.3630061] snprintf() at netbsd:snprintf
[ 317.3630061] kasan_report() at netbsd:kasan_report+0x98 kasan_code_name sys/kern/subr_asan.c:186 [inline]
[ 317.3630061] kasan_report() at netbsd:kasan_report+0x98 sys/kern/subr_asan.c:196
[ 317.3630061] __asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_4byte_isvalid sys/kern/subr_asan.c:346 [inline]
[ 317.3630061] __asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_8byte_isvalid sys/kern/subr_asan.c:360 [inline]
[ 317.3630061] __asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_check sys/kern/subr_asan.c:412 [inline]
[ 317.3630061] __asan_load8() at netbsd:__asan_load8+0x294 sys/kern/subr_asan.c:1182
[ 317.3630061] rw_dump() at netbsd:rw_dump+0x20 sys/kern/kern_rwlock.c:186
[ 317.3630061] lockdebug_dump() at netbsd:lockdebug_dump+0x269 sys/kern/subr_lockdebug.c:809
[ 317.3630061] lockdebug_show_one() at netbsd:lockdebug_show_one+0xca sys/kern/subr_lockdebug.c:889
[ 317.3630061] lockdebug_show_all_locks() at netbsd:lockdebug_show_all_locks+0x11b lockdebug_show_all_locks_lwp sys/kern/subr_lockdebug.c:941 [inline]
[ 317.3630061] lockdebug_show_all_locks() at netbsd:lockdebug_show_all_locks+0x11b sys/kern/subr_lockdebug.c:991
[ 317.3630061] db_command() at netbsd:db_command+0x2c0 sys/ddb/db_command.c:942
[ 317.3630061] db_command_loop() at netbsd:db_command_loop+0x26c db_execute_commandlist sys/ddb/db_command.c:439 [inline]
[ 317.3630061] db_command_loop() at netbsd:db_command_loop+0x26c sys/ddb/db_command.c:589
[ 317.3630061] db_trap() at netbsd:db_trap+0x219 sys/ddb/db_trap.c:94
[ 317.3630061] kdb_trap() at netbsd:kdb_trap+0x1ce sys/arch/amd64/amd64/db_interface.c:248
[ 317.3630061] trap() at netbsd:trap+0x591 sys/arch/amd64/amd64/trap.c:315
[ 317.3630061] --- trap (number 1) ---
[ 317.3630061] breakpoint() at netbsd:breakpoint+0x5
[ 317.3630061] db_panic() at netbsd:db_panic+0xe9 sys/ddb/db_panic.c:67
[ 317.3630061] vpanic() at netbsd:vpanic+0x244 sys/kern/subr_prf.c:336
[ 317.3630061] snprintf() at netbsd:snprintf
[ 317.3630061] kasan_report() at netbsd:kasan_report+0x98 kasan_code_name sys/kern/subr_asan.c:186 [inline]
[ 317.3630061] kasan_report() at netbsd:kasan_report+0x98 sys/kern/subr_asan.c:196
[ 317.3630061] __asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_4byte_isvalid sys/kern/subr_asan.c:346 [inline]
[ 317.3630061] __asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_8byte_isvalid sys/kern/subr_asan.c:360 [inline]
[ 317.3630061] __asan_load8() at netbsd:__asan_load8+0x294 kasan_shadow_check sys/kern/subr_asan.c:412 [inline]
[ 317.3630061] __asan_load8() at netbsd:__asan_load8+0x294 sys/kern/subr_asan.c:1182
[ 317.3630061] pg_delete() at netbsd:pg_delete+0xd1 sys/kern/kern_proc.c:1136
[ 317.3630061] proc_leavepgrp() at netbsd:proc_leavepgrp+0x1bb sys/kern/kern_proc.c:1072
[ 317.3630061] do_sys_waitid() at netbsd:do_sys_waitid+0x1116 proc_free sys/kern/kern_exit.c:1220 [inline]
[ 317.3630061] do_sys_waitid() at netbsd:do_sys_waitid+0x1116 sys/kern/kern_exit.c:676
[ 317.3630061] do_sys_wait() at netbsd:do_sys_wait+0x1c3 sys/kern/kern_exit.c:711
[ 317.3630061] sys___wait450() at netbsd:sys___wait450+0x10e sys/kern/kern_exit.c:731
[ 317.3630061] syscall() at netbsd:syscall+0x57e sy_call sys/sys/syscallvar.h:65 [inline]
[ 317.3630061] syscall() at netbsd:syscall+0x57e sy_invoke sys/sys/syscallvar.h:94 [inline]
[ 317.3630061] syscall() at netbsd:syscall+0x57e sys/arch/x86/x86/syscall.c:138
[ 317.3630061] --- syscall (number 449) ---
[ 317.3630061] 71e99524279a:
[ 317.3630061] cpu1: End traceback...
[ 317.3630061] fatal breakpoint trap in supervisor mode
[ 317.3630061] trap type 1 code 0 rip 0xffffffff8021e4b5 cs 0x8 rflags 0x246 cr2 0x71e9961067c0 ilevel 0x8 rsp 0xffff97817f079c60
[ 317.3630061] curlwp 0xffff978012c32540 pid 1.1 lowest kstack 0xffff97817f0732c0
Stopped in pid 1.1 (init) at    netbsd:breakpoint+0x5:  leave

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/16 01:41 netbsd 102c7bbf5808 749688d2 .config console log report ci2-netbsd
* Struck through repros no longer work on HEAD.