On Sat, Jan 25, 2025 at 10:17:36AM +0100, Anton Lindqvist wrote:
> On Fri, Jan 24, 2025 at 02:19:07AM -0700, Vitaliy Makkoveev wrote:
> > CVSROOT:    /cvs
> > Module name:        src
> > Changes by: m...@cvs.openbsd.org    2025/01/24 02:19:07
> > 
> > Modified files:
> >     sys/net        : if.c if_var.h 
> > 
> > Log message:
> > Move interface groups copyout(9)s out of netlock within ifioctl_get().
> > 
> > The interface groups use complicated linking scheme with special data
> > structures allowing to link multiple interfaces with multiple groups.
> > We can't use iterators here, because some path are netlock covered and
> > we can't sleep in refcnt_finalize(9). We also can't use double locking
> > to protect this linking data because this new lock will cover very wide
> > area in kernel.
> > 
> > Link desired interface groups or interfaces from group into temporary
> > lists, protected by new dedicated `if_tmplist_lock' rwlock(9). Bump the
> > reference counter to make concurrent destruction thread wait until
> > temporary linked data became unused.
> > 
> > Delivered data are immutable, so netlock required only while filling
> > temporary lists.
> > 
> > ok bluhm
> 
> My amd64 regress machine locks up while running regress/usr.sbin/snmpd,
> cannot spawn new processes nor enter ddb. Bisected to this commit
> introducing the regression.

Sorry, I made stupid mitype with this diff. Fixed in tree.

Index: sys/net/if.c
===================================================================
RCS file: /cvs/src/sys/net/if.c,v
retrieving revision 1.724
diff -u -p -r1.724 if.c
--- sys/net/if.c        24 Jan 2025 09:19:07 -0000      1.724
+++ sys/net/if.c        25 Jan 2025 10:45:54 -0000
@@ -3195,7 +3195,7 @@ if_getgrouplist(caddr_t data)
                NET_LOCK_SHARED();
                TAILQ_FOREACH(ifg, &ifg_head, ifg_next)
                        ifgr->ifgr_len += sizeof(ifgrq);
-               NET_LOCK_SHARED();
+               NET_UNLOCK_SHARED();
                return (0);
        }
 

Reply via email to