From fb8b3d1b2d2f4cab22b95409df049ab5eb442424 Mon Sep 17 00:00:00 2001 From: mvs Date: Wed, 14 Jun 2023 14:30:08 +0000 Subject: [PATCH] Add missing kernel lock around (*if_ioctl)(). ok bluhm --- sys/netinet/ip_mroute.c | 4 +++- sys/netinet6/ip6_mroute.c | 4 +++- 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); -- 2.20.1