summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-06-14 14:30:09 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-06-14 14:30:09 +0000
commit4f73b047957a1a93de70e729d0c0b290f6dd1c8a (patch)
tree2f0f1d46f742de2f4dd67f87b9bfef2f706a8193
parentebe4ca5fd1d243556dcbd54b076915e876e6606e (diff)
Add missing kernel lock around (*if_ioctl)().
ok bluhm
-rw-r--r--sys/netinet/ip_mroute.c4
-rw-r--r--sys/netinet6/ip6_mroute.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 3dd7dab22fe..a667c90ccb2 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_mroute.c,v 1.138 2023/04/19 20:03:51 kn Exp $ */
+/* $OpenBSD: ip_mroute.c,v 1.139 2023/06/14 14:30:08 mvs Exp $ */
/* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */
/*
@@ -718,7 +718,9 @@ add_vif(struct socket *so, struct mbuf *m)
satosin(&ifr.ifr_addr)->sin_len = sizeof(struct sockaddr_in);
satosin(&ifr.ifr_addr)->sin_family = AF_INET;
satosin(&ifr.ifr_addr)->sin_addr = zeroin_addr;
+ KERNEL_LOCK();
error = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, (caddr_t)&ifr);
+ KERNEL_UNLOCK();
if (error)
return (error);
}
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index bb805e50471..615c9fd07eb 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_mroute.c,v 1.136 2023/04/19 20:03:52 kn Exp $ */
+/* $OpenBSD: ip6_mroute.c,v 1.137 2023/06/14 14:30:08 mvs Exp $ */
/* $NetBSD: ip6_mroute.c,v 1.59 2003/12/10 09:28:38 itojun Exp $ */
/* $KAME: ip6_mroute.c,v 1.45 2001/03/25 08:38:51 itojun Exp $ */
@@ -610,7 +610,9 @@ add_m6if(struct socket *so, struct mif6ctl *mifcp)
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_addr.sin6_family = AF_INET6;
ifr.ifr_addr.sin6_addr = in6addr_any;
+ KERNEL_LOCK();
error = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, (caddr_t)&ifr);
+ KERNEL_UNLOCK();
if (error) {
if_put(ifp);