syzbot


assert "!ISSET(rt->rt_flags, RTF_LOCAL)" failed in nd6.c

Status: fixed on 2020/04/22 21:18
Reported-by: syzbot+0eb994ff432ae75e3369@syzkaller.appspotmail.com
Fix commit: 8e6c5245c1d8 Never update the ND entry (cache) corresponding to a RTF_LOCAL route.
First crash: 1725d, last: 1725d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
openbsd assert "!ISSET(rt->rt_flags, RTF_LOCAL)" failed in nd6.c (3) 4 89d 216d 0/3 upstream: reported on 2024/04/19 03:54
openbsd assert "!ISSET(rt->rt_flags, RTF_LOCAL)" failed in nd6.c (2) 1 1670d 1670d 0/3 auto-closed as invalid on 2020/07/25 17:46

Sample crash report:
panic: kernel diagnostic assertion "!ISSET(rt->rt_flags, RTF_LOCAL)" failed: file "/syzkaller/managers/multicore/kernel/sys/netinet6/nd6.c", line 727
Stopped at      db_enter+0x18:  addq    $0x8,%rsp
    TID    PID    UID     PRFLAGS     PFLAGS  CPU  COMMAND
 497148   3642      0           0          0    0  syz-executor.0
* 39472   3642      0           0  0x4000000    1K syz-executor.0
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398
panic(ffffffff821e91f1) at panic+0x15c sys/kern/subr_prf.c:207
__assert(ffffffff8224237e,ffffffff822397a7,2d7,ffffffff82228384) at __assert+0x2b sys/kern/subr_prf.c:154
nd6_free(fffffd80655b1008) at nd6_free+0x1cf sys/netinet6/nd6.c:727
nd6_purge(ffff800000a3d000) at nd6_purge+0x10f sys/netinet6/nd6.c:534
in6_ifdetach(ffff800000a3d000) at in6_ifdetach+0xa7 sys/netinet6/in6_ifattach.c:432
ifioctl(fffffd806f6f3e10,801169ac,ffff800021b7ef50,ffff800020ad7ae8) at ifioctl+0x1652 sys/net/if.c:1989
soo_ioctl(fffffd806fc82980,801169ac,ffff800021b7ef50,ffff800020ad7ae8) at soo_ioctl+0x27c sys/kern/sys_socket.c:138
sys_ioctl(ffff800020ad7ae8,ffff800021b7f068,ffff800021b7f0b0) at sys_ioctl+0x4a5
syscall(ffff800021b7f130) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff800021b7f130) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7ae8d76540, count: 4
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}> set $maxwidth = 0
ddb{1}> show panic
kernel diagnostic assertion "!ISSET(rt->rt_flags, RTF_LOCAL)" failed: file "/syzkaller/managers/multicore/kernel/sys/netinet6/nd6.c", line 727
ddb{1}> trace
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398
panic(ffffffff821e91f1) at panic+0x15c sys/kern/subr_prf.c:207
__assert(ffffffff8224237e,ffffffff822397a7,2d7,ffffffff82228384) at __assert+0x2b sys/kern/subr_prf.c:154
nd6_free(fffffd80655b1008) at nd6_free+0x1cf sys/netinet6/nd6.c:727
nd6_purge(ffff800000a3d000) at nd6_purge+0x10f sys/netinet6/nd6.c:534
in6_ifdetach(ffff800000a3d000) at in6_ifdetach+0xa7 sys/netinet6/in6_ifattach.c:432
ifioctl(fffffd806f6f3e10,801169ac,ffff800021b7ef50,ffff800020ad7ae8) at ifioctl+0x1652 sys/net/if.c:1989
soo_ioctl(fffffd806fc82980,801169ac,ffff800021b7ef50,ffff800020ad7ae8) at soo_ioctl+0x27c sys/kern/sys_socket.c:138
sys_ioctl(ffff800020ad7ae8,ffff800021b7f068,ffff800021b7f0b0) at sys_ioctl+0x4a5
syscall(ffff800021b7f130) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff800021b7f130) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7ae8d76540, count: -11
ddb{1}> show registers
rdi               0xffffffff81030db7    db_enter+0x17
rsi                          0x1fe0f    acpi_pdirpa+0xbc77
rbp               0xffff800021b7ec10
rbx               0xffff800021b7ecc0
rdx                          0x1fe10    acpi_pdirpa+0xbc78
rcx               0xffff800023bd0000
rax               0xffff800023bd0000
r8                0xffffffff8164a22f    kprintf+0x16f
r9                               0x1
r10                             0x25
r11               0x92d673ad5dc50425
r12                     0x3000000008
r13               0xffff800021b7ec20
r14                            0x100
r15                              0x1
rip               0xffffffff81030db8    db_enter+0x18
cs                               0x8
rflags                         0x246
rsp               0xffff800021b7ec00
ss                              0x10
db_enter+0x18:  addq    $0x8,%rsp
ddb{1}> show proc
PROC (syz-executor.0) pid=39472 stat=onproc
    flags process=0 proc=4000000<THREAD>
    pri=32, usrpri=86, nice=20
    forw=0xffffffffffffffff, list=0xffff800020ad6eb8,0xffffffff8262fc20
    process=0xffff800020a9cf20 user=0xffff800021b7a000, vmspace=0xfffffd807f0008a0
    estcpu=36, cpticks=1, pctcpu=0.0
    user=0, sys=1, intr=0
ddb{1}> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
  3642  497148  34011      0  7           0                syz-executor.0
* 3642   39472  34011      0  7   0x4000000                syz-executor.0
 34011  523669  94690      0  3        0x82  nanosleep     syz-executor.0
 64830  306964  94690      0  3         0x2  biowait       syz-executor.1
 94885   24282      0      0  3     0x14200  bored         sosplice
 94690  116276  50418      0  3        0x82  kqread        syz-fuzzer
 94690  191064  50418      0  3   0x4000082  nanosleep     syz-fuzzer
 94690  509664  50418      0  3   0x4000082  thrsleep      syz-fuzzer
 94690  451369  50418      0  3   0x4000082  thrsleep      syz-fuzzer
 94690  394882  50418      0  3   0x4000082  thrsleep      syz-fuzzer
 94690  207249  50418      0  3   0x4000082  thrsleep      syz-fuzzer
 94690  198907  50418      0  3   0x4000082  thrsleep      syz-fuzzer
 94690  139368  50418      0  3   0x4000082  thrsleep      syz-fuzzer
 94690  380623  50418      0  3   0x4000082  thrsleep      syz-fuzzer
 94690  374348  50418      0  3   0x4000082  thrsleep      syz-fuzzer
 50418  521209  90433      0  3    0x10008a  pause         ksh
 90433  196708   3101      0  3        0x92  select        sshd
  7032   92527      1      0  3    0x100083  ttyin         getty
  3101  164624      1      0  3        0x80  select        sshd
 21578  460513  35295     74  3    0x100092  bpf           pflogd
 35295  127813      1      0  3        0x80  netio         pflogd
 18604  410574  78010     73  3    0x100090  kqread        syslogd
 78010   91355      1      0  3    0x100082  netio         syslogd
 47041  348678      0      0  3     0x14200  bored         smr
 55740  479740      0      0  3     0x14200  pgzero        zerothread
 96569  227386      0      0  3     0x14200  aiodoned      aiodoned
 73358  183881      0      0  3     0x14200  syncer        update
 39744  199242      0      0  3     0x14200  cleaner       cleaner
 42182   14683      0      0  3     0x14200  reaper        reaper
 65126  294800      0      0  3     0x14200  pgdaemon      pagedaemon
 45354  456405      0      0  3     0x14200  bored         crynlk
 66716  505028      0      0  3     0x14200  bored         crypto
 10513  144831      0      0  3  0x40014200  acpi0         acpi0
 38760  416575      0      0  3  0x40014200                idle1
 31873  489813      0      0  3     0x14200  bored         softnet
 88593  124288      0      0  2     0x14200                systqmp
 99067  236931      0      0  3     0x14200  bored         systq
 54967  236111      0      0  3  0x40014200  bored         softclock
 55797  239099      0      0  3  0x40014200                idle0
     1  220598      0      0  3        0x82  wait          init
     0       0     -1      0  3     0x10200  scheduler     swapper
ddb{1}> show all locks
Process 3642 (syz-executor.0) thread 0xffff800020ad7ae8 (39472)
exclusive rwlock netlock r = 0 (0xffffffff8249c838)
#0  witness_lock+0x52e sys/kern/subr_witness.c:1164
#1  ifioctl+0x104b sys/net/if.c:1978
#2  soo_ioctl+0x27c sys/kern/sys_socket.c:138
#3  sys_ioctl+0x4a5
#4  syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#4  syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570
#5  Xsyscall+0x128
exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82638db0)
#0  witness_lock+0x52e sys/kern/subr_witness.c:1164
#1  soo_ioctl+0x26a sys/kern/sys_socket.c:138
#2  sys_ioctl+0x4a5
#3  syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#3  syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570
#4  Xsyscall+0x128
Process 64830 (syz-executor.1) thread 0xffff800020ad6018 (306964)
exclusive rrwlock inode r = 0 (0xfffffd8068fdd708)
#0  witness_lock+0x52e sys/kern/subr_witness.c:1164
#1  rw_enter+0x453 sys/kern/kern_rwlock.c:309
#2  rrw_enter+0x88 sys/kern/kern_rwlock.c:453
#3  VOP_LOCK+0x4b sys/kern/vfs_vops.c:602
#4  vn_lock+0x81 sys/kern/vfs_vnops.c:575
#5  vget+0x1c8 sys/kern/vfs_subr.c:671
#6  ufs_ihashget+0x141 sys/ufs/ufs/ufs_ihash.c:119
#7  ffs_vget+0x74 sys/ufs/ffs/ffs_vfsops.c:1329
#8  ufs_lookup+0x14b7 sys/ufs/ufs/ufs_lookup.c:487
#9  VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90
#10 vfs_lookup+0x7a6 sys/kern/vfs_lookup.c:568
#11 namei+0x63c sys/kern/vfs_lookup.c:249
#12 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1860
#13 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#13 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570
#14 Xsyscall+0x128
exclusive rrwlock inode r = 0 (0xfffffd8077b35818)
#0  witness_lock+0x52e sys/kern/subr_witness.c:1164
#1  rw_enter+0x453 sys/kern/kern_rwlock.c:309
#2  rrw_enter+0x88 sys/kern/kern_rwlock.c:453
#3  VOP_LOCK+0x4b sys/kern/vfs_vops.c:602
#4  vn_lock+0x81 sys/kern/vfs_vnops.c:575
#5  vfs_lookup+0xe6 sys/kern/vfs_lookup.c:419
#6  namei+0x63c sys/kern/vfs_lookup.c:249
#7  dounlinkat+0x99 sys/kern/vfs_syscalls.c:1860
#8  syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#8  syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570
#9  Xsyscall+0x128
ddb{1}> show malloc
           Type InUse  MemUse  HighUse   Limit  Requests Type Lim
         devbuf  9531   6361K    6864K  78643K     11797        0
            pcb    13      8K       8K  78643K       188        0
         rtable    94     12K      12K  78643K       539        0
         ifaddr    99     20K      20K  78643K       263        0
       counters    43     33K      34K  78643K       101        0
       ioctlops     0      0K       4K  78643K      1507        0
            iov     0      0K      32K  78643K        98        0
          mount     1      1K       1K  78643K         1        0
         vnodes  1221     77K      77K  78643K      1626        0
      UFS quota     1     32K      32K  78643K         1        0
      UFS mount     5     36K      36K  78643K         5        0
            shm     2      1K       5K  78643K         9        0
         VM map     2      1K       1K  78643K         2        0
            sem    12      1K       1K  78643K       178        0
        dirhash    12      2K       2K  78643K        12        0
           ACPI  1809    196K     290K  78643K     12766        0
      file desc     5     13K      25K  78643K       639        0
          sigio     0      0K       0K  78643K        15        0
           proc    62     51K      95K  78643K       606        0
        subproc    32      2K       2K  78643K        68        0
    NFS srvsock     1      0K       0K  78643K         1        0
     NFS daemon     1     16K      16K  78643K         1        0
    ip_moptions     0      0K       0K  78643K        83        0
       in_multi    96      4K       4K  78643K       231        0
    ether_multi     1      0K       0K  78643K        31        0
            mrt     0      0K       0K  78643K         2        0
    ISOFS mount     1     32K      32K  78643K         1        0
  MSDOSFS mount     1     16K      16K  78643K         1        0
           ttys    55    254K     254K  78643K        55        0
           exec     0      0K       1K  78643K       290        0
        pagedep     1      8K       8K  78643K         1        0
       inodedep     1     32K      32K  78643K         1        0
         newblk     1      0K       0K  78643K         1        0
        VM swap     7     26K      26K  78643K         7        0
       UVM amap   121     71K      71K  78643K      3179        0
       UVM aobj    45      2K       2K  78643K        47        0
        memdesc     1      4K       4K  78643K         1        0
    crypto data     1      1K       1K  78643K         1        0
    ip6_options     0      0K       0K  78643K       133        0
            NDP    14      0K       0K  78643K        53        0
           temp   140   3026K    3102K  78643K     14574        0
         kqueue     3      4K      18K  78643K        63        0
      SYN cache     2     16K      16K  78643K         2        0
ddb{1}> show all pools
Name      Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
arp         64       13    0        5     1     0     1     1     0     8    0
plcache    128       20    0        0     1     0     1     1     0     8    0
rtpcb       80       83    0       83     1     0     1     1     0     8    1
rtentry    112       89    0       55     2     0     2     2     0     8    0
unpcb      120      578    0      569     1     0     1     1     0     8    0
syncache   264        8    0        8     3     2     1     1     0     8    1
tcpqe       32       66    0       66     2     1     1     1     0     8    1
tcpcb      544      403    0      399     2     1     1     2     0     8    0
inpcb      280     1182    0     1173     3     1     2     2     0     8    1
nd6         48       14    0       10     1     0     1     1     0     8    0
pkpcb       40        5    0        5     2     2     0     1     0     8    0
ppxss      1128       5    0        5     3     3     0     1     0     8    0
pfosfp      40      846    0      423     5     0     5     5     0     8    0
pfosfpen   112     1428    0      714    21     0    21    21     0     8    0
pfstitem    24       69    0       36     1     0     1     1     0     8    0
pfstkey    112       69    0       36     2     1     1     2     0     8    0
pfstate    328       69    0       36     4     1     3     4     0     8    0
pfrule     1360      21    0       16     2     1     1     2     0     8    0
art_heap8  4096       1    0        0     1     0     1     1     0     8    0
art_heap4  256      459    0      292    14     3    11    13     0     8    0
art_table   32      460    0      292     2     0     2     2     0     8    0
art_node    16       87    0       56     1     0     1     1     0     8    0
sysvmsgpl   40       37    0       16     1     0     1     1     0     8    0
semupl     112        3    0        3     1     1     0     1     0     8    0
semapl     112      176    0      166     1     0     1     1     0     8    0
shmpl      112       45    0        2     2     0     2     2     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino1pl    128     2290    0      881    46     0    46    46     0     8    0
ffsino     272     2290    0      881    96     1    95    95     0     8    0
nchpl      144     3426    0     1818    61     0    61    61     0     8    0
uvmvnodes   72     2627    0        0    48     0    48    48     0     8    0
vnodes     208     2627    0        0   139     0   139   139     0     8    0
namei      1024   11094    0    11094     2     1     1     1     0     8    1
percpumem   16       61    0       29     1     0     1     1     0     8    0
vcpupl     1984       7    0        0     1     0     1     1     0     8    0
vmpool     560        9    0        2     1     0     1     1     0     8    0
scxspl     192    10502    0    10501     8     7     1     7     0     8    0
plimitpl   152       64    0       57     1     0     1     1     0     8    0
sigapl     424      849    0      819     4     0     4     4     0     8    0
futexpl     56    13425    0    13425     2     1     1     1     0     8    1
knotepl    112      158    0      139     1     0     1     1     0     8    0
kqueuepl   144      223    0      221     1     0     1     1     0     8    0
pipelkpl    48      292    0      282     1     0     1     1     0     8    0
pipepl     120      584    0      565     3     2     1     2     0     8    0
fdescpl    496      833    0      819     3     0     3     3     0     8    0
filepl     152     7031    0     6941     9     4     5     6     0     8    1
lockfpl    104      208    0      208     1     0     1     1     0     8    1
lockfspl    48       77    0       77     1     0     1     1     0     8    1
sessionpl  112       20    0       11     1     0     1     1     0     8    0
pgrppl      48       29    0       20     1     0     1     1     0     8    0
ucredpl     96      542    0      534     1     0     1     1     0     8    0
zombiepl   144      819    0      819     3     2     1     1     0     8    1
processpl  960      849    0      819     5     0     5     5     0     8    0
procpl     624     2284    0     2244     4     0     4     4     0     8    0
sosppl     128       16    0       16     4     3     1     1     0     8    1
sockpl     400     1870    0     1856     7     4     3     5     0     8    1
mcl64k     65536      9    0        0     2     0     2     2     0     8    0
mcl16k     16384      1    0        0     1     0     1     1     0     8    0
mcl12k     12288      4    0        0     1     0     1     1     0     8    0
mcl9k      9216       5    0        0     1     0     1     1     0     8    0
mcl8k      8192       9    0        0     2     0     2     2     0     8    0
mcl4k      4096       7    0        0     1     0     1     1     0     8    0
mcl2k2     2112       3    0        0     1     0     1     1     0     8    0
mcl2k      2048     168    0        0    20     0    20    20     0     8    0
mtagpl      80       63    0        0     2     0     2     2     0     8    0
mbufpl     256      345    0        0    18     0    18    18     0     8    0
bufpl      280     7664    0     1396   448     0   448   448     0     8    0
anonpl      16   110824    0    93175    96     8    88    88     0   124   16
amapchunkpl 152    6039    0     5912    33    26     7    20     0   158    1
amappl16   192     4747    0     3770    78    21    57    62     0     8    8
amappl15   184       12    0        9     1     0     1     1     0     8    0
amappl14   176       85    0       81     2     1     1     1     0     8    0
amappl13   168       37    0       36     1     0     1     1     0     8    0
amappl12   160       18    0       14     2     1     1     1     0     8    0
amappl11   152       82    0       69     1     0     1     1     0     8    0
amappl10   144       25    0       19     1     0     1     1     0     8    0
amappl9    136      784    0      778     1     0     1     1     0     8    0
amappl8    128      755    0      720     4     2     2     2     0     8    0
amappl7    120      140    0      126     1     0     1     1     0     8    0
amappl6    112       21    0       19     2     1     1     1     0     8    0
amappl5    104      728    0      715     1     0     1     1     0     8    0
amappl4     96      546    0      517     2     1     1     2     0     8    0
amappl3     88      195    0      189     1     0     1     1     0     8    0
amappl2     80     5615    0     5552     3     1     2     3     0     8    0
amappl1     72    28510    0    28099    25    15    10    20     0     8    0
amappl      80     2581    0     2538     2     0     2     2     0    84    0
dma4096    4096       1    0        1     1     1     0     1     0     8    0
dma256     256        6    0        6     1     1     0     1     0     8    0
dma128     128      253    0      253     1     1     0     1     0     8    0
dma64       64        6    0        6     1     1     0     1     0     8    0
dma32       32        7    0        7     1     1     0     1     0     8    0
dma16       16       18    0       17     1     0     1     1     0     8    0
aobjpl      64       46    0        2     1     0     1     1     0     8    0
uaddrrnd    24      842    0      821     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24      842    0      821     1     0     1     1     0     8    0
vmmpekpl   168    10553    0    10515     2     0     2     2     0     8    0
vmmpepl    168   109937    0   107865   162    47   115   130     0   357   18
vmsppl     368      841    0      821     2     0     2     2     0     8    0
pdppl      4096    1691    0     1649     6     0     6     6     0     8    0
pvpl        32   307933    0   287178   223    17   206   213     0   265   37
pmappl     232      841    0      821     2     0     2     2     0     8    0
extentpl    40       46    0       29     1     0     1     1     0     8    0
phpool     112      185    0       13     5     0     5     5     0     8    0

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/02 18:35 openbsd 23a32f86e8aa 4a4e0509 .config console log report ci-openbsd-multicore
* Struck through repros no longer work on HEAD.