From: kn Date: Mon, 14 Nov 2022 22:45:02 +0000 (+0000) Subject: Unlock SIOCGIFG{MEMB,ATTR,LIST} X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6197d1caec9afed7164a45747cb33003c458aeb0;p=openbsd Unlock SIOCGIFG{MEMB,ATTR,LIST} The global interface group list is also protected by the net lock and all access to it (all within if.c) take it accordingly. Getting all - members of a group (SIOCGIFGMEMB), - attributes of a group (SIOCGIFGATTR), - groups (SIOCGIFGLIST) are each read-only operations on the global interface group `ifg_head'. The global interface list `ifnetlist' or its per-interface group lists are not used in these ioctls. OK mvs --- diff --git a/sys/net/if.c b/sys/net/if.c index d62b40b2f01..f3fba33de3f 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.679 2022/11/14 22:07:30 kn Exp $ */ +/* $OpenBSD: if.c,v 1.680 2022/11/14 22:45:02 kn Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -2427,25 +2427,19 @@ ifioctl_get(u_long cmd, caddr_t data) error = if_clone_list((struct if_clonereq *)data); return (error); case SIOCGIFGMEMB: - KERNEL_LOCK(); NET_LOCK_SHARED(); error = if_getgroupmembers(data); NET_UNLOCK_SHARED(); - KERNEL_UNLOCK(); return (error); case SIOCGIFGATTR: - KERNEL_LOCK(); NET_LOCK_SHARED(); error = if_getgroupattribs(data); NET_UNLOCK_SHARED(); - KERNEL_UNLOCK(); return (error); case SIOCGIFGLIST: - KERNEL_LOCK(); NET_LOCK_SHARED(); error = if_getgrouplist(data); NET_UNLOCK_SHARED(); - KERNEL_UNLOCK(); return (error); }