panic: chgproccnt: procs < NUM

Status: upstream: reported on 2025/02/22 06:58
Reported-by: syzbot+265d5006dac2f45c9e9d@syzkaller.appspotmail.com
First crash: 622d, last: 2d22h

Sample crash report:
panic: chgproccnt: procs < 0
Stopped at      db_enter+0x25:  addq    $0x8,%rsp
    TID    PID    UID     PRFLAGS     PFLAGS  CPU  COMMAND
*433226  64996  60929        0x10  0x4000000    0  syz-executor
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff835348bf) at panic+0x1cf sys/kern/subr_prf.c:198
chgproccnt(1,ffffffff) at chgproccnt+0xcc
sys_setuid(ffff80002a77a7e0,ffff80003b0fb730,ffff80003b0fb680) at sys_setuid+0x2e9 sys/kern/kern_prot.c:746
syscall(ffff80003b0fb730) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline]
syscall(ffff80003b0fb730) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xa2d20350f60, count: 9
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> 
ddb> set $lines = 0
ddb> set $maxwidth = 0
ddb> show panic
*cpu0: chgproccnt: procs < 0
ddb> show kasan
No such command
ddb> trace
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff835348bf) at panic+0x1cf sys/kern/subr_prf.c:198
chgproccnt(1,ffffffff) at chgproccnt+0xcc
sys_setuid(ffff80002a77a7e0,ffff80003b0fb730,ffff80003b0fb680) at sys_setuid+0x2e9 sys/kern/kern_prot.c:746
syscall(ffff80003b0fb730) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline]
syscall(ffff80003b0fb730) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xa2d20350f60, count: -6
ddb> show registers
rdi                                0
rsi                              0x1
rbp               0xffff80003b0fb520
rbx                                0
rdx                                0
rcx                                0
rax               0xffff80002a77a7e0
r8                 0x101010101010101
r9                0x8080808080808080
r10               0xcab6e5149feb50bc
r11                0xd22bd27f05d9f02
r12                                0
r13               0xfffffb0007ffd4e0
r14                                0
r15                              0x1
rip               0xffffffff8178b545    db_enter+0x25
cs                               0x8
rflags                         0x246
rsp               0xffff80003b0fb510
ss                              0x10
db_enter+0x25:  addq    $0x8,%rsp
ddb> show proc
PROC (syz-executor) tid=433226 pid=64996 tcnt=4 stat=onproc
    flags process=10<SUGID> proc=4000000<THREAD>
    runpri=79, usrpri=79, slppri=36, nice=20
    wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0
    forw=0xffffffffffffffff, list=0xffff80002a77b240,0xffffffff839bc3e0
    process=0xffff800045ff8928 user=0xffff80003b0f6000, vmspace=0xfffffb006d9fee78
    estcpu=29, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0
ddb> ps
   PID     TID   PPID   UID  S      PRLAGS     PFLAGS WAIT      COMMAND
 32418   57458  60785     0  2           0          0           syz-executor
 32418  238076  60785     0  3           0  0x4000080 fsleep    syz-executor
  1394  366262  80541     0  2           0          0           syz-executor
  1394  224089  80541     0  2           0  0x4000000           syz-executor
  1394  401376  80541     0  3           0  0x4000080 fsleep    syz-executor
 72061    5611  78950     0  2           0          0           syz-executor
 72061   71861  78950     0  3           0  0x4000080 fsleep    syz-executor
 66626  463222  56072     0  2           0          0           syz-executor
 66626  130270  56072     0  3           0  0x4000080 fsleep    syz-executor
 66626  444686  56072     0  3           0  0x4000080 fsleep    syz-executor
 66626  332949  56072     0  3           0  0x4000080 fsleep    syz-executor
 64996  299180  73506 60929  2        0x10          0           syz-executor
 64996  461696  73506 60929  3        0x10  0x4000080 fsleep    syz-executor
 64996   68317  73506 60929  2        0x10  0x4000000           syz-executor
*64996  433226  73506 60929  7        0x10  0x4000000           syz-executor
 60785  490640  32046     0  3         0x2       0x80 nanoslp   syz-executor
 45717  488318  11893     0  2           0          0           syz-executor
 45717  342420  11893     0  3           0  0x4000080 fsleep    syz-executor
 67799  369099  32046     0  3         0x2       0x80 wait      syz-executor
 26836  108748  32046     0  2         0x2          0           syz-executor
 11893  434554  32046     0  3         0x2       0x80 nanoslp   syz-executor
 78950  288287  32046     0  2         0x2        0x1           syz-executor
 56072  514622  32046     0  3         0x2       0x80 nanoslp   syz-executor
 73506  356129  32046     0  3         0x2       0x80 nanoslp   syz-executor
 80541  461734  32046     0  3         0x2       0x80 nanoslp   syz-executor
 32046  518745  90500     0  3         0x2       0x80 kqread    syz-executor
 90500    5822  56170     0  3    0x100002       0x88 sigsusp   ksh
 56170   96028   7918     0  3        0x10       0x88 kqread    sshd-session
  7918  206596  58517     0  3        0x12       0x80 kqread    sshd-session
 37587  298141      1     0  3    0x100003       0x80 ttyin     getty
 58517  115099      1     0  3           0       0x88 kqread    sshd
 44830  119303  42544    73  3   0x1100010       0x80 kqread    syslogd
 42544  179056      1     0  3    0x100002       0x80 sbwait    syslogd-parent
  4856  228197      1     0  3    0x100000       0x80 kqread    resolvd
 96619  298022  91292    77  3    0x100012       0x80 kqread    dhcpleased
 50616    8783  91292    77  3    0x100012       0x80 kqread    dhcpleased
 91292  496111      1     0  3           0       0x80 kqread    dhcpleased
 90533  158474      0     0  3     0x14000      0x200 bored     smr
 81613  454774      0     0  2     0x14000      0x200           zerothread
 96272  382803      0     0  3     0x14000      0x200 aiodoned  aiodoned
 27472  126260      0     0  3     0x14000      0x200 syncer    update
 54697   71287      0     0  3     0x14000      0x200 cleaner   cleaner
 90428  393389      0     0  3     0x14000      0x200 reaper    reaper
 13345  211158      0     0  3     0x14000      0x200 pgdaemon  pagedaemon
 96890  244428      0     0  3     0x14000      0x200 bored     viomb
 77583  334890      0     0  3     0x14000 0x40000200 acpi0     acpi0
 56979   10647      0     0  3     0x14000      0x200 bored     softnet0
 76961  308255      0     0  3     0x14000      0x200 bored     systqmp
 42908  414805      0     0  3     0x14000      0x200 bored     systq
 39142  112945      0     0  3     0x14000 0x40000200 tmoslp    softclock
 53676   62799      0     0  3     0x14000 0x40000200           idle0
     1    9624      0     0  3         0x2       0x80 wait      init
     0       0     -1     0  3     0x10000      0x200 scheduler swapper
ddb> show all locks
No such command
ddb> show malloc
           Type InUse  MemUse  HighUse   Limit  Requests Type Lim
         devbuf 11032  12121K   12245K 166960K     12286        0
            pcb    17     12K      12K 166960K        55        0
         rtable   229      7K       8K 166960K       925        0
             pf    31     13K      15K 166960K        83        0
         ifaddr    40      7K       7K 166960K       127        0
        ifgroup    50      2K       2K 166960K       139        0
         sysctl     3      1K       9K 166960K         7        0
       counters    33     17K      18K 166960K        57        0
       ioctlops     0      0K       4K 166960K        75        0
            iov     0      0K      12K 166960K         2        0
          mount     1      1K       1K 166960K         1        0
            log     0      0K       0K 166960K         4        0
         vnodes  1332     84K      84K 166960K      1664        0
      UFS quota     1     32K      32K 166960K         1        0
      UFS mount     5     36K      36K 166960K         5        0
            shm     2      1K       5K 166960K         5        0
         VM map     2      1K       1K 166960K         2        0
            sem     7      0K       0K 166960K         9        0
        dirhash    12      2K       2K 166960K        12        0
           ACPI  1734    201K     291K 166960K     11964        0
      file desc    17     61K      97K 166960K       539        0
          sigio     0      0K       0K 166960K         2        0
           proc    61     59K      83K 166960K      1039        0
        subproc    72      4K       4K 166960K       243        0
    NFS srvsock     1      0K       0K 166960K         1        0
     NFS daemon     1     16K      16K 166960K         1        0
    ip_moptions     0      0K       0K 166960K         5        0
       in_multi    89      6K       6K 166960K       298        0
    ether_multi     1      0K       0K 166960K         1        0
            mrt     0      0K       0K 166960K        22        0
    ISOFS mount     1     32K      32K 166960K         1        0
  MSDOSFS mount     1     16K      16K 166960K         1        0
           ttys    43    201K     201K 166960K        43        0
           exec     0      0K       1K 166960K       617        0
   fusefs mount     1     32K      32K 166960K         1        0
            tdb     3      0K       0K 166960K         3        0
        VM swap     8     62K      64K 166960K        10        0
       UVM amap   218    151K     165K 166960K      5696        0
       UVM aobj     6      2K       2K 166960K        11        0
     pinsyscall    38     76K      96K 166960K      2123        0
        memdesc     1      4K       4K 166960K         1        0
    crypto data     1      1K       1K 166960K         1        0
    ip6_options     0      0K       0K 166960K         9        0
            NDP    19      1K       1K 166960K        87        0
           temp    35   9114K    9178K 166960K     15275        0
         kqueue    13     20K      26K 166960K        39        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       86    0       83     1     0     1     1     0     8    0
rtentry    136      314    0      211     4     0     4     4     0     8    0
unpcb      144      105    0       89     1     0     1     1     0     8    0
syncache   336        6    0        6     2     1     1     1     0     8    1
tcpcb      736       44    0       40     1     0     1     1     0     8    0
arp         96       56    0       38     1     0     1     1     0     8    0
inpcb      328      231    0      224     3     1     2     2     0     8    1
nd6        112       79    0       58     1     0     1     1     0     8    0
pkpcb       40        2    0        2     2     1     1     1     0     8    1
kcovpl      48       27    0       19     1     0     1     1     0     8    0
ppxss      1072       4    0        4     1     0     1     1     0     8    1
pfstscr     40        2    0        2     1     0     1     1     0     8    1
pfstkey    128        2    0        2     1     0     1     1     0     8    1
pfstate    384        1    0        1     1     0     1     1     0     8    1
pfrule     1360       2    0        2     1     0     1     1     0     8    1
art_heap8  4096       2    0        0     2     0     2     2     0     8    0
art_heap4  256     1261    0      844    29     0    29    29     0     8    2
art_table   40     1263    0      844     5     0     5     5     0     8    0
art_node    32      314    0      220     1     0     1     1     0     8    0
semapl      72        7    0        2     1     0     1     1     0     8    0
shmpl      120        8    0        5     1     0     1     1     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino2pl    256     1852    0      338    95     0    95    95     0     8    0
ffsino     256     1852    0      338    95     0    95    95     0     8    0
nchpl      144     2210    0      442    67     1    66    66     0     8    0
vnodes     216     2185    0        0   122     0   122   122     0     8    0
namei      1024    9360    0     9359     3     1     2     2     0     8    1
kstatmem   264       71    0       48     2     0     2     2     0     8    0
scsiplug    72        2    0        2     1     0     1     1     0     8    1
scxspl     216     8523    0     8523     9     7     2     8     1     8    2
plimitpl   152       68    0       51     1     0     1     1     0     8    0
sigapl     424      791    0      749     7     1     6     6     0     8    1
knotepl    120     6456    0     6409     2     0     2     2     0     8    0
kqueuepl   184       52    0       43     1     0     1     1     0     8    0
pipepl     304      188    0      161     3     0     3     3     0     8    0
fdescpl    448      778    0      749     5     1     4     5     0     8    0
filepl     120     2587    0     2381     8     0     8     8     0     8    1
lockfpl    104       40    0       38     1     0     1     1     0     8    0
lockfspl    48       20    0       18     1     0     1     1     0     8    0
sessionpl  144       46    0       38     1     0     1     1     0     8    0
pgrppl      48       76    0       60     1     0     1     1     0     8    0
ucredpl    104      174    0      160     1     0     1     1     0     8    0
zombiepl   144      858    0      857     1     0     1     1     0     8    0
processpl  1160     791    0      749     4     0     4     4     0     8    0
procpl     664     1072    0     1019     6     0     6     6     0     8    1
sosppl     176        2    0        2     1     0     1     1     0     8    1
sockpl     552      429    0      403     3     0     3     3     0     8    1
mcl64k     65536      1    0        1     1     0     1     1     0     8    1
mcl8k      8192      12    0       12     1     1     0     1     0     8    0
mcl4k      4096    2711    0     2657    15     6     9    14     0     8    0
mcl2k      2048     549    0      549     6     2     4     4     0     8    4
mextrefs    64      181    0      181     1     0     1     1     0     8    1
mtagpl      96        4    0        4     1     1     0     1     0     8    0
mbufpl     256     7124    0     6980    18     1    17    17     0     8    3
bufpl      272     2813    0       91   182     0   182   182     0     8    0
anonpl      24   119351    0   116296    69     0    69    69     0   187   43
amapchunkpl 152   16324    0    15858    32     0    32    32     0   158   14
amappl16   200     1812    0     1797    27    17    10    27     0     8    8
amappl15   192       15    0       14     1     0     1     1     0     8    0
amappl14   184      622    0      620     1     0     1     1     0     8    0
amappl13   176      152    0      142     1     0     1     1     0     8    0
amappl12   168     1084    0     1056     2     0     2     2     0     8    0
amappl11   160        3    0        3     1     1     0     1     0     8    0
amappl10   152       62    0       54     1     0     1     1     0     8    0
amappl9    144      284    0      283     1     0     1     1     0     8    0
amappl8    136      168    0      167     1     0     1     1     0     8    0
amappl7    128      178    0      166     1     0     1     1     0     8    0
amappl6    120      230    0      228     1     0     1     1     0     8    0
amappl5    112      202    0      196     1     0     1     1     0     8    0
amappl4    104      317    0      304     1     0     1     1     0     8    0
amappl3     96     3153    0     3038     4     0     4     4     0     8    0
amappl2     88      514    0      467     2     0     2     2     0     8    0
amappl1     80    12961    0    12407    13     0    13    13     0     8    1
amappl      88     4701    0     4544     5     0     5     5     0    92    0
uvmvnodes   80      103    0        0     3     0     3     3     0     8    0
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        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      72       10    0        5     1     0     1     1     0     8    0
uaddrrnd    24      778    0      749     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24      778    0      749     1     0     1     1     0     8    0
vmmpekpl   168     7641    0     7583     3     0     3     3     0     8    0
vmmpepl    168    59278    0    57552   103     3   100   100     0   357   24
vmsppl     368      777    0      749     4     1     3     4     0     8    0
rwobjpl     40    19426    0    18485    15     0    15    15     0     8    3
pdppl      4096    1562    0     1498   116    48    68    82     0     8    4
pvpl        32   329178    0   321258   144     0   144   144     0   265   64
pmappl     216      777    0      749     3     0     3     3     0     8    1
extentpl    40       46    0       28     1     0     1     1     0     8    0
phpool     112      582    0       64    15     0    15    15     0     8    0
ddb> machine ddbcpu 0
No such command
ddb> trace
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff835348bf) at panic+0x1cf sys/kern/subr_prf.c:198
chgproccnt(1,ffffffff) at chgproccnt+0xcc
sys_setuid(ffff80002a77a7e0,ffff80003b0fb730,ffff80003b0fb680) at sys_setuid+0x2e9 sys/kern/kern_prot.c:746
syscall(ffff80003b0fb730) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline]
syscall(ffff80003b0fb730) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xa2d20350f60, count: -6
ddb> machine ddbcpu 1
No such command
ddb> trace
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff835348bf) at panic+0x1cf sys/kern/subr_prf.c:198
chgproccnt(1,ffffffff) at chgproccnt+0xcc
sys_setuid(ffff80002a77a7e0,ffff80003b0fb730,ffff80003b0fb680) at sys_setuid+0x2e9 sys/kern/kern_prot.c:746
syscall(ffff80003b0fb730) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline]
syscall(ffff80003b0fb730) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xa2d20350f60, count: -6

Crashes (27):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/04 01:18 openbsd 928141eb6cf7 5af5b6c6 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main panic: chgproccnt: procs < NUM
2026/10/29 15:35 openbsd 253abe37cce3 4902417d .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main panic: chgproccnt: procs < NUM
2026/10/19 16:32 openbsd 10825b7eb358 440f8011 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main panic: chgproccnt: procs < NUM
2026/10/05 15:13 openbsd fe7391f28055 af63e995 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/07/23 13:29 openbsd 6c9531571979 71a13572 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/07/11 19:33 openbsd bdda9179e659 d78ea535 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/07/05 21:32 openbsd 549eb3d3b3c2 fcece630 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/07/02 22:56 openbsd 5420d8a5f716 2b70b115 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/06/23 12:13 openbsd a7fbd22dd6cd 4b1d8f01 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main panic: chgproccnt: procs < NUM
2026/06/17 11:11 openbsd 2f229140c828 62cc6db3 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/06/10 12:48 openbsd 01c8afc2223d f79bac11 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main panic: chgproccnt: procs < NUM
2026/05/23 22:06 openbsd 19a8be4fa5c4 c69befb3 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/05/11 18:40 openbsd 9c5367037e8c 340bcdf0 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main panic: chgproccnt: procs < NUM
2026/04/26 21:07 openbsd 443952c09f98 9c2d0995 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main panic: chgproccnt: procs < NUM
2026/04/18 09:57 openbsd a9044055e1bf 1a086e7c .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/04/17 12:45 openbsd 2dd8b2a80c95 1a086e7c .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/03/27 00:28 openbsd 9c6370df4fcd 4b3d9a38 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main panic: chgproccnt: procs < NUM
2026/03/24 06:56 openbsd 2084961b940b baf8bf12 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/03/22 13:46 openbsd 67e6794a9e1c 5b92003d .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2026/01/24 12:14 openbsd 652212f689da 40acda8a .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main panic: chgproccnt: procs < NUM
2025/11/27 22:07 openbsd 7de01a79e4ba e8331348 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2025/11/16 02:48 openbsd 42d4ce758e42 f7988ea4 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-main panic: chgproccnt: procs < NUM
2025/08/26 13:20 openbsd d9624900b8bd bf27483f .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2025/06/18 01:39 openbsd 7cbb080c3e94 e77fae15 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2025/05/17 15:40 openbsd 007267a8c99a f41472b0 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2025/05/12 09:11 openbsd 1d7d4b26237d 77908e5f .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
2025/02/22 06:57 openbsd 6a403588e274 d34966d1 .config console log report [disk image] [bsd.gdb] [kernel image] ci-openbsd-multicore panic: chgproccnt: procs < NUM
* Struck through repros no longer work on HEAD.