From: Tom Smyth Subject: Re: add an opaque driver settable identifier to struct ifnet To: David Gwynne Cc: tech Date: Sat, 14 Nov 2026 13:33:53 +0000 sorry, just to clarify, my testing of interface ops setting up tearing down adding ports removing ports suffered no regressions in my testing with the 2 diffs dlg@ sent on Friday, On Sat, 14 Nov 2026 at 03:09, Tom Smyth wrote: > > Thanks David, > > running both of your diffs on tech@ yesterday , on latest current > > > > Last login: Sat Nov 14 02:51:17 on tty00 > OpenBSD 8.0-current (GENERIC.MP) #0: Fri Nov 13 14:47:37 GMT 2026 > > Welcome to OpenBSD: The proactively secure Unix-like operating system. > > > obsd-ci-agent-158# ifconfig pair100 create rdomain 100 up > obsd-ci-agent-158# ifconfig vether100 create rdomain 100 > obsd-ci-agent-158# ifconfig vether100 inet 10.0.100.1/24 up > obsd-ci-agent-158# route -nT100 show -inet > Routing tables > > Internet: > Destination Gateway Flags Refs Use Mtu Prio Iface > 10.0.100/24 10.0.100.1 UCn 0 0 - > 4 vether100 > 10.0.100.1 fe:e1:ba:d1:64:86 UHLl 0 0 - > 1 vether100 > 10.0.100.255 10.0.100.1 UHb 0 0 - > 1 vether100 > obsd-ci-agent-158# ifconfig pair100 patch vether100 > ifconfig: SIOCSIFPAIR: Operation not supported by device > obsd-ci-agent-158# route -nT100 show -inet > Routing tables > > Internet: > Destination Gateway Flags Refs Use Mtu Prio Iface > 10.0.100/24 10.0.100.1 Cn 0 0 - > 4 vether100 > 10.0.100.1 fe:e1:ba:d1:64:86 UHLl 0 0 - > 1 vether100 > 10.0.100.255 10.0.100.1 Hb 0 0 - > 1 vether100 > obsd-ci-agent-158# ifconfig pair100 patch lo100 > uvm_fault(0xfffffb017dbaa188, 0x560, 0, 1) -> e > fatal page fault in supervisor mode > trap type 6 code 0 rip ffffffff81731406 cs 8 rflags 10202 cr2 560 cpl > 0 rsp ffff8000454d3700 > gsbase 0xffffffff82b35ff0 kgsbase 0x0 > panic: trap type 6, code=0, pc=ffffffff81731406 > Starting stack trace... > panic(ffffffff826fe841) at panic+0x170 > kerntrap(ffff8000454d3650) at kerntrap+0x15d > alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b > pairioctl(ffff800000657000,802069b0,ffff8000454d3830) at pairioctl+0x276 > ifioctl(ffff800001087a10,802069b0,ffff8000454d3830,ffff8000454ff250) > at ifioctl+0xa4f > sys_ioctl(ffff8000454ff250,ffff8000454d39f0,ffff8000454d3970) at sys_ioctl+0x30e > syscall(ffff8000454d39f0) at syscall+0x60d > Xsyscall() at Xsyscall+0x128 > end of kernel > end trace frame: 0x70249ed400e0, count: 249 > End of stack trace. > panic: netlock rwlock 0xffffffff82aeb040: enter write deadlock > Starting stack trace... > panic(ffffffff827523f3) at panic+0x170 > rw_do_enter_write(ffffffff82aeb040,0) at rw_do_enter_write+0x265 > if_downall() at if_downall+0x29 > boot(104) at boot+0xde > reboot(104) at reboot+0x68 > panic(ffffffff826fe841) at panic+0x184 > kerntrap(ffff8000454d3650) at kerntrap+0x15d > alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b > pairioctl(ffff800000657000,802069b0,ffff8000454d3830) at pairioctl+0x276 > ifioctl(ffff800001087a10,802069b0,ffff8000454d3830,ffff8000454ff250) > at ifioctl+0xa4f > sys_ioctl(ffff8000454ff250,ffff8000454d39f0,ffff8000454d3970) at sys_ioctl+0x30e > syscall(ffff8000454d39f0) at syscall+0x60d > Xsyscall() at Xsyscall+0x128 > end of kernel > end trace frame: 0x70249ed400e0, count: 244 > End of stack trace. > panic: netlock rwlock 0xffffffff82aeb040: enter write deadlock > Starting stack trace... > panic(ffffffff827523f3) at panic+0x170 > rw_do_enter_write(ffffffff82aeb040,0) at rw_do_enter_write+0x265 > if_downall() at if_downall+0x29 > boot(104) at boot+0xde > reboot(104) at reboot+0x68 > panic(ffffffff827523f3) at panic+0x184 > rw_do_enter_write(ffffffff82aeb040,0) at rw_do_enter_write+0x265 > if_downall() at if_downall+0x29 > boot(104) at boot+0xde > reboot(104) at reboot+0x68 > panic(ffffffff826fe841) at panic+0x184 > kerntrap(ffff8000454d3650) at kerntrap+0x15d > alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b > pairioctl(ffff800000657000,802069b0,ffff8000454d3830) at pairioctl+0x276 > ifioctl(ffff800001087a10,802069b0,ffff8000454d3830,ffff8000454ff250) > at ifioctl+0xa4f > sys_ioctl(ffff8000454ff250,ffff8000454d39f0,ffff8000454d3970) at sys_ioctl+0x30e > syscall(ffff8000454d39f0) at syscall+0x60d > Xsyscall() at Xsyscall+0x128 > end of kernel > end trace frame: 0x70249ed400e0, count: 239 > End of stack trace. > panic: netlock rwlock 0xffffffff82aeb040: enter write deadlock > Starting stack trace... > panic(ffffffff827523f3) at panic+0x170 > rw_do_enter_write(ffffffff82aeb040,0) at rw_do_enter_write+0x265 > if_downall() at if_downall+0x29 > boot(104) at boot+0xde > reboot(104) at reboot+0x68 > panic(ffffffff827523f3) at panic+0x184 > rw_do_enter_write(fffffff > > > the following change in if_pair.c prevents panic from patch trying to connect > an incompatible interfaces. > Index: if_pair.c > --- if_pair.c > +++ if_pair.c > @@ -239,6 +239,8 @@ pairioctl(struct ifnet *ifp, u_long cmd, > if (newifp != NULL) { > /* Only allow pair(4) interfaces for the pair */ > if (!if_is_pair(newifp)) { > + if_put(newifp); > + newifp = NULL; > error = ENODEV; > break; > } -- Kindest regards, Tom Smyth.