syzbot


protection_fault: bpfdetach

Status: upstream: reported on 2025/02/16 16:28
Reported-by: syzbot+47d95e88904ebdae1d04@syzkaller.appspotmail.com
First crash: 145d, last: 12d

Sample crash report:
kernel: protection fault trap, code=0
Stopped at      bpfdetach+0x40: movq    0(%r15),%r12
ddb> 
ddb> set $lines = 0
ddb> set $maxwidth = 0
ddb> show panic
the kernel did not panic
ddb> trace
bpfdetach(ffff80000149b800) at bpfdetach+0x40 sys/net/bpf.c:1778
if_detach(ffff80000149b800) at if_detach+0x1bb sys/net/if.c:1214
tun_clone_destroy(ffff80000149b800) at tun_clone_destroy+0x2aa sys/net/if_tun.c:346
if_clone_destroy(ffff80003811ce30) at if_clone_destroy+0x1d7 sys/net/if.c:1403
sys_ioctl(ffff80003c988d08,ffff80003811d010,ffff80003811cf60) at sys_ioctl+0x5bf sys/kern/sys_generic.c:-1
syscall(ffff80003811d010) at syscall+0x97e mi_syscall sys/sys/syscall_mi.h:-1 [inline]
syscall(ffff80003811d010) at syscall+0x97e sys/arch/amd64/amd64/trap.c:637
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xd3a95346360, count: -7
ddb> show registers
rdi                                0
rsi                                0
rbp               0xffff80003811cd20
rbx               0xffff80003811d010
rdx                                0
rcx               0xffffffff837a7ff0    cpu_info_full_primary+0x1ff0
rax               0xffff80003c988d08
r8                              0x78
r9                                 0
r10               0xf0e055c3313e7e44
r11               0xadcd27a884de4106
r12               0xdead0002deadbeef
r13                            0x800
r14               0xffff80000149b800
r15               0xdead0002deadbeef
rip               0xffffffff83270180    bpfdetach+0x40
cs                               0x8
rflags                       0x10246    __ALIGN_SIZE+0xf246
rsp               0xffff80003811ccf0
ss                              0x10
bpfdetach+0x40: movq    0(%r15),%r12
ddb> show proc
PROC (syz-executor) tid=239281 pid=75642 tcnt=2 stat=onproc
    flags process=1000<SINGLEEXIT> proc=4080000<SUSPSINGLE,THREAD>
    runpri=32, usrpri=85, slppri=32, nice=20
    wchan=0x0, wmesg=, ps_single=0xffff80003c9887e8 scnt=1 ecnt=0
    forw=0xffffffffffffffff, list=0xffff80003c9887e8,0xffff8000315022c8
    process=0xffff80002a874488 user=0xffff800038118000, vmspace=0xfffffd806c28bcb8
    estcpu=35, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0
ddb> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
 19576  369914  38368      0  2           0                syz-executor
 42722  481624  83375      0  2           0                syz-executor
 42722  323019  83375      0  2   0x4000000                syz-executor
 26631   40384  93396      0  2           0                syz-executor
 26631  478521  93396      0  3   0x4000080  fsleep        syz-executor
 64233   58043  25432      0  2           0                syz-executor
 64233  174351  25432      0  3   0x4000080  fsleep        syz-executor
 75642  329802  27863      0  3      0x3000  suspend       syz-executor
*75642  239281  27863      0  7   0x4081000                syz-executor
 99841  385963      1      0  3    0x100083  ttyin         getty
 27863  450133  54075      0  3        0x82  nanoslp       syz-executor
 50701  316519      0      0  3     0x14200  bored         sosplice
 87333  296146      0      0  3     0x14280  nfsidl        nfsio
 51344   97588      0      0  3     0x14280  nfsidl        nfsio
 75908  480943      0      0  3     0x14280  nfsidl        nfsio
 78361  481818      0      0  3     0x14280  nfsidl        nfsio
 52280  339528      0      0  3     0x14280  nfsidl        nfsio
 40827  402493      0      0  3     0x14280  nfsidl        nfsio
  7451   57627      0      0  3     0x14280  nfsidl        nfsio
 28406  453399      0      0  3     0x14280  nfsidl        nfsio
 44640  278735      0      0  3     0x14280  nfsidl        nfsio
 35722  509339      0      0  3     0x14280  nfsidl        nfsio
  4400  429307      0      0  3     0x14280  nfsidl        nfsio
  2097  459569      0      0  3     0x14280  nfsidl        nfsio
 45090   89143      0      0  3     0x14280  nfsidl        nfsio
 79820  224521      0      0  3     0x14280  nfsidl        nfsio
 41785  475105      0      0  3     0x14280  nfsidl        nfsio
 45701  327266      0      0  3     0x14280  nfsidl        nfsio
 11557  171140      0      0  3     0x14280  nfsidl        nfsio
 40956  110921      0      0  3     0x14280  nfsidl        nfsio
 66575  137546      0      0  3     0x14280  nfsidl        nfsio
 73625  434309      0      0  3     0x14280  nfsidl        nfsio
 25432  264456  54075      0  3        0x82  nanoslp       syz-executor
 83375  484383  54075      0  3        0x82  nanoslp       syz-executor
 38368  341637  54075      0  3        0x82  nanoslp       syz-executor
 93396  410486  54075      0  3        0x82  nanoslp       syz-executor
 24257  254418  54075      0  2         0x2                syz-executor
 85502  133808  54075      0  3        0x82  nanoslp       syz-executor
 30051  342353  54075      0  2         0x2                syz-executor
 54075  405182   9552      0  2         0x2                syz-executor
  9552  382264  74106      0  3    0x10008a  sigsusp       ksh
 74106  341235  64548      0  3        0x98  kqread        sshd-session
 64548   16673  22149      0  3        0x92  kqread        sshd-session
 22149  409273      1      0  3        0x88  kqread        sshd
 46949  247564  50182     73  3   0x1100090  kqread        syslogd
 50182  324455      1      0  3    0x100082  sbwait        syslogd
 21160  488034      1      0  3    0x100080  kqread        resolvd
 21900  249120   1109     77  2    0x100012                dhcpleased
 74408  219206   1109     77  3    0x100092  kqread        dhcpleased
  1109  130313      1      0  3        0x80  kqread        dhcpleased
 22591  492618      0      0  3     0x14200  bored         smr
 10490  350936      0      0  2     0x14200                zerothread
 43604  183587      0      0  3     0x14200  aiodoned      aiodoned
 24051   67114      0      0  3     0x14200  syncer        update
  2927  300983      0      0  3     0x14200  cleaner       cleaner
 46419  169785      0      0  2     0x14200                reaper
 31770  281128      0      0  3     0x14200  pgdaemon      pagedaemon
 62236  188773      0      0  3     0x14200  bored         viomb
  2260  197939      0      0  3  0x40014200  acpi0         acpi0
  6553  262375      0      0  3     0x14200  bored         softnet3
 17599  226976      0      0  3     0x14200  bored         softnet2
 95707  170530      0      0  3     0x14200  bored         softnet1
 94147  209699      0      0  3     0x14200  bored         softnet0
 58500  104816      0      0  3     0x14200  bored         systqmp
 69013  408949      0      0  3     0x14200  bored         systq
 21114  388890      0      0  3  0x40014200  tmoslp        softclock
 55135  377900      0      0  3  0x40014200                idle0
     1  150220      0      0  3     0x80082  wait          init
     0       0     -1      0  3  0x10010200  scheduler     swapper
ddb> show all locks
No such command
ddb> show malloc
           Type InUse  MemUse  HighUse   Limit  Requests Type Lim
         devbuf 10195  11178K   11567K 166960K     13623        0
            pcb    18     16K      24K 166960K       406        0
         rtable   154      8K       9K 166960K       575        0
             pf    33     13K      16K 166960K       152        0
         ifaddr    28      4K       7K 166960K       117        0
        ifgroup    53      2K       2K 166960K       198        0
         sysctl     4      1K       9K 166960K        16        0
       counters    32     17K      18K 166960K       104        0
       ioctlops     0      0K       4K 166960K       436        0
            iov     0      0K      24K 166960K       147        0
          mount     1      1K       1K 166960K         1        0
            log     0      0K       0K 166960K         4        0
         vnodes  1463     92K      93K 166960K      2785        0
      UFS quota     1     32K      32K 166960K         1        0
      UFS mount     5     36K      36K 166960K         5        0
            shm     2      1K       9K 166960K        26        0
         VM map     2      1K       1K 166960K         2        0
            sem    12      0K       0K 166960K       129        0
        dirhash    12      2K       2K 166960K        30        0
           ACPI  1692    195K     286K 166960K     12470        0
      file desc    17     61K     106K 166960K      1520        0
          sigio     0      0K       0K 166960K        22        0
           proc    60     59K     124K 166960K       681        0
        subproc    72      4K       4K 166960K        81        0
    NFS srvsock     1      0K       0K 166960K         1        0
     NFS daemon     1     16K      16K 166960K         1        0
    ip_moptions     0      0K       0K 166960K       228        0
       in_multi    51      3K       7K 166960K       199        0
    ether_multi     1      0K       0K 166960K        11        0
            mrt     1      0K       0K 166960K        21        0
    ISOFS mount     1     32K      32K 166960K         1        0
  MSDOSFS mount     1     16K      16K 166960K         1        0
           ttys   109    493K     493K 166960K       109        0
           exec     0      0K       1K 166960K       624        0
   fusefs mount     1     32K      32K 166960K         1        0
     pfkey data     0      0K       0K 166960K         1        0
            tdb     3      0K       0K 166960K         3        0
        VM swap     8     62K      64K 166960K        10        0
       UVM amap   205    160K     185K 166960K     15247        0
       UVM aobj   105      6K       6K 166960K       111        0
     pinsyscall    38     76K      96K 166960K      2589        0
        memdesc     1      4K       4K 166960K         1        0
    crypto data     1      1K       1K 166960K         1        0
    ip6_options     0      0K       0K 166960K        62        0
            NDP    11      0K       2K 166960K        72        0
           temp    72   8686K    8781K 166960K     60433        0
         kqueue    14     22K      30K 166960K       271        0
      SYN cache     2     16K      16K 166960K         2        0
ddb> show all pools
Name      Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
rtpcb      120      158    0      155     2     1     1     2     0     8    0
rtentry    136      188    0      129     4     0     4     4     0     8    0
unpcb      144     1278    0     1262    10     8     2     6     0     8    1
syncache   336        8    0        8     3     2     1     1     0     8    1
tcpqe       32        4    0        4     3     2     1     1     0     8    1
tcpcb      736      608    0      601    11     7     4     7     0     8    3
arp         88       32    0       21     1     0     1     1     0     8    0
ipq         40        3    0        3     1     0     1     1     0     8    1
ipqe        40        7    0        7     1     0     1     1     0     8    1
inpcb      328     1843    0     1832    17    10     7     7     0     8    5
ip6q        72        2    0        1     1     0     1     1     0     8    0
ip6af       40        2    0        1     1     0     1     1     0     8    0
nd6        104       33    0       18     1     0     1     1     0     8    0
pkpcb       40       10    0       10     2     1     1     1     0     8    1
kcovpl      48        9    0        1     1     0     1     1     0     8    0
mppekey    1024       2    0        2     1     0     1     1     0     8    1
ppxss      1072      50    0       50     3     2     1     1     0     8    1
pppxif     1384      16    0       16     3     2     1     1     0     8    1
pfanchor   1288       1    0        1     1     1     0     1     0     8    0
pfrule     1344       2    0        2     1     1     0     1     0     8    0
rttmr      136        5    0        4     2     1     1     1     0     8    0
art_heap8  4096       3    0        0     3     0     3     3     0     8    0
art_heap4  256      859    0      592    29     6    23    29     0     8    3
art_table   32      862    0      592     4     0     4     4     0     8    0
art_node    16      179    0      126     1     0     1     1     0     8    0
sysvmsgpl   40       15    0       10     1     0     1     1     0     8    0
semapl     112      127    0      117     1     0     1     1     0     8    0
shmpl      112      108    0        6     3     0     3     3     0     8    0
dirhash    1024      29    0       12     3     0     3     3     0     8    0
dino2pl    256     4242    0     2747    95     0    95    95     0     8    0
ffsino     248     4242    0     2747    95     0    95    95     0     8    0
nchpl      144     6418    0     4734    63     0    63    63     0     8    0
rtmask      32        6    0        6     2     1     1     1     0     8    1
uvmvnodes   80     5199    0        0   107     0   107   107     0     8    0
vnodes     216     5199    0        0   289     0   289   289     0     8    0
namei      1024   22052    0    22052     3     2     1     2     0     8    1
kstatmem   264      108    0       86     2     0     2     2     0     8    0
scsiplug    72        8    0        8     3     2     1     1     0     8    1
scxspl     216    20037    0    20037    11     8     3     8     1     8    3
plimitpl   152      505    0      489     1     0     1     1     0     8    0
sigapl     424     1819    0     1752    10     2     8     8     0     8    0
knotepl    120    63993    0    63691    33    22    11    15     0     8    1
kqueuepl   184      575    0      565     4     3     1     4     0     8    0
pipepl     296      195    0      167     3     0     3     3     0     8    0
fdescpl    440     1778    0     1749     5     1     4     5     0     8    0
filepl     120    12189    0    11976    17     7    10    14     0     8    2
lockfpl    104      771    0      768     2     0     2     2     0     8    1
lockfspl    48      348    0      345     1     0     1     1     0     8    0
sessionpl  144       28    0       20     1     0     1     1     0     8    0
pgrppl      48       53    0       37     1     0     1     1     0     8    0
ucredpl    104     1937    0     1926     1     0     1     1     0     8    0
zombiepl   144     2329    0     2327     2     1     1     1     0     8    0
processpl  1160    1819    0     1752     6     0     6     6     0     8    0
procpl     656     4139    0     4068     8     0     8     8     0     8    0
sosppl     168        1    0        1     1     0     1     1     0     8    1
sockpl     528     3399    0     3369    25    18     7    14     0     8    4
mcl64k     65536    139    0      139     3     2     1     1     0     8    1
mcl16k     16384     27    0       27     2     1     1     1     0     8    1
mcl12k     12288      4    0        4     1     0     1     1     0     8    1
mcl9k      9216       6    0        6     2     1     1     1     0     8    1
mcl8k      8192      33    0       33     3     2     1     1     0     8    1
mcl4k      4096    4519    0     4466    14     5     9    12     0     8    2
mcl2k2     2112       2    0        2     2     1     1     1     0     8    1
mcl2k      2048    1658    0     1653     5     3     2     3     0     8    1
mtagpl      96      109    0       91     2     0     2     2     0     8    1
mbufpl     256    18889    0    18794    22     8    14    22     0     8    2
bufpl      280     5875    0      131   411     0   411   411     0     8    0
anonpl      24   262977    0   259884    68    21    47    47     0   187   17
amapchunkpl 152   52323    0    51924    46    13    33    34     0   158   12
amappl16   200     4676    0     4640    37    25    12    16     0     8    8
amappl15   192        8    0        8     1     1     0     1     0     8    0
amappl14   184      129    0      119     1     0     1     1     0     8    0
amappl13   176        4    0        3     2     1     1     1     0     8    0
amappl12   168     2402    0     2375     3     1     2     3     0     8    0
amappl11   160       44    0       34     1     0     1     1     0     8    0
amappl10   152        9    0        8     2     1     1     1     0     8    0
amappl9    144      249    0      249     1     1     0     1     0     8    0
amappl8    136       22    0       20     1     0     1     1     0     8    0
amappl7    128      110    0       99     1     0     1     1     0     8    0
amappl6    120      186    0      182     1     0     1     1     0     8    0
amappl5    112      128    0      120     1     0     1     1     0     8    0
amappl4    104      300    0      284     1     0     1     1     0     8    0
amappl3     96    10515    0    10422     5     1     4     4     0     8    0
amappl2     88      668    0      609     2     0     2     2     0     8    0
amappl1     80    14545    0    14002    15     0    15    15     0     8    1
amappl      88    14284    0    14145     6     1     5     5     0    92    0
dma16384   16384      1    0        1     1     0     1     1     0     8    1
dma4096    4096       1    0        1     1     1     0     1     0     8    0
dma1024    1024       1    0        0     1     0     1     1     0     8    0
dma256     256       76    0       76     3     2     1     1     0     8    1
dma128     128      255    0      255     3     2     1     1     0     8    1
dma64       64        6    0        6     1     1     0     1     0     8    0
dma32       32       10    0       10     3     2     1     1     0     8    1
dma16       16       18    0       17     1     0     1     1     0     8    0
aobjpl      72      110    0        6     2     0     2     2     0     8    0
uaddrrnd    24     1778    0     1749     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24     1778    0     1749     1     0     1     1     0     8    0
vmmpekpl   168    15029    0    14984     3     0     3     3     0     8    0
vmmpepl    168   115586    0   113766   113    10   103   103     0   357   11
vmsppl     360     1777    0     1748     4     1     3     4     0     8    0
rwobjpl     32    35359    0    29222    51     0    51    51     0     8    0
pdppl      4096    3563    0     3496   125    58    67    83     0     8    0
pvpl        32   786756    0   778717   137    22   115   116     0   265   17
pmappl     216     1777    0     1748     3     0     3     3     0     8    0
extentpl    40       45    0       27     1     0     1     1     0     8    0
phpool     112      328    0       99     8     1     7     8     0     8    0
ddb> machine ddbcpu 0
No such command
ddb> trace
bpfdetach(ffff80000149b800) at bpfdetach+0x40 sys/net/bpf.c:1778
if_detach(ffff80000149b800) at if_detach+0x1bb sys/net/if.c:1214
tun_clone_destroy(ffff80000149b800) at tun_clone_destroy+0x2aa sys/net/if_tun.c:346
if_clone_destroy(ffff80003811ce30) at if_clone_destroy+0x1d7 sys/net/if.c:1403
sys_ioctl(ffff80003c988d08,ffff80003811d010,ffff80003811cf60) at sys_ioctl+0x5bf sys/kern/sys_generic.c:-1
syscall(ffff80003811d010) at syscall+0x97e mi_syscall sys/sys/syscall_mi.h:-1 [inline]
syscall(ffff80003811d010) at syscall+0x97e sys/arch/amd64/amd64/trap.c:637
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xd3a95346360, count: -7
ddb> machine ddbcpu 1
No such command
ddb> trace
bpfdetach(ffff80000149b800) at bpfdetach+0x40 sys/net/bpf.c:1778
if_detach(ffff80000149b800) at if_detach+0x1bb sys/net/if.c:1214
tun_clone_destroy(ffff80000149b800) at tun_clone_destroy+0x2aa sys/net/if_tun.c:346
if_clone_destroy(ffff80003811ce30) at if_clone_destroy+0x1d7 sys/net/if.c:1403
sys_ioctl(ffff80003c988d08,ffff80003811d010,ffff80003811cf60) at sys_ioctl+0x5bf sys/kern/sys_generic.c:-1
syscall(ffff80003811d010) at syscall+0x97e mi_syscall sys/sys/syscall_mi.h:-1 [inline]
syscall(ffff80003811d010) at syscall+0x97e sys/arch/amd64/amd64/trap.c:637
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xd3a95346360, count: -7

Crashes (16):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/29 14:17 openbsd b4d1cb14c459 fc9d8ee5 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main protection_fault: bpfdetach
2025/06/17 14:03 openbsd 154de61c2e99 a5686133 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main protection_fault: bpfdetach
2025/06/16 12:43 openbsd b38eaba60654 d1716036 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main protection_fault: bpfdetach
2025/06/10 05:28 openbsd eb252dbb8be6 4826c28e .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore protection_fault: bpfdetach
2025/06/09 16:58 openbsd 1ccd80029b5d 4826c28e .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore protection_fault: bpfdetach
2025/06/06 05:41 openbsd b57dcb7bc7e3 6b6b5f21 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore protection_fault: bpfdetach
2025/06/03 20:25 openbsd e4273848146a a30356b7 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore protection_fault: bpfdetach
2025/05/17 18:02 openbsd 007267a8c99a f41472b0 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore protection_fault: bpfdetach
2025/05/16 05:41 openbsd 84d74105a289 cfde8269 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore protection_fault: bpfdetach
2025/04/11 09:46 openbsd 5990a1963d9d 94486846 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore protection_fault: bpfdetach
2025/04/01 07:11 openbsd 6cbbb384a28a e2826670 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main protection_fault: bpfdetach
2025/03/08 12:51 openbsd 083866324387 7e3bd60d .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main protection_fault: bpfdetach
2025/03/04 05:09 openbsd 4602d4e06be3 c3901742 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main protection_fault: bpfdetach
2025/02/23 19:47 openbsd c8d1658b9cef d34966d1 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore protection_fault: bpfdetach
2025/02/17 13:02 openbsd c48feb9479a9 4121cf9d .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore protection_fault: bpfdetach
2025/02/16 16:27 openbsd 3411e7e2a484 40a34ec9 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore protection_fault: bpfdetach
* Struck through repros no longer work on HEAD.