Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jan 2012 19:56:30 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r229637 - stable/9/sys/netinet6
Message-ID:  <201201051956.q05JuUiI052750@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Jan  5 19:56:30 2012
New Revision: 229637
URL: http://svn.freebsd.org/changeset/base/229637

Log:
  MFC 228866:
  Fix a bug where TAILQ_FIRST(&V_ifnet) was accessed without holding the
  proper lock.

Modified:
  stable/9/sys/netinet6/icmp6.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/netinet6/icmp6.c
==============================================================================
--- stable/9/sys/netinet6/icmp6.c	Thu Jan  5 19:53:17 2012	(r229636)
+++ stable/9/sys/netinet6/icmp6.c	Thu Jan  5 19:56:30 2012	(r229637)
@@ -1851,7 +1851,7 @@ static int
 ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
     struct ifnet *ifp0, int resid)
 {
-	struct ifnet *ifp = ifp0 ? ifp0 : TAILQ_FIRST(&V_ifnet);
+	struct ifnet *ifp;
 	struct in6_ifaddr *ifa6;
 	struct ifaddr *ifa;
 	struct ifnet *ifp_dep = NULL;
@@ -1864,6 +1864,7 @@ ni6_store_addrs(struct icmp6_nodeinfo *n
 		return (0);	/* needless to copy */
 
 	IFNET_RLOCK_NOSLEEP();
+	ifp = ifp0 ? ifp0 : TAILQ_FIRST(&V_ifnet);
   again:
 
 	for (; ifp; ifp = TAILQ_NEXT(ifp, if_list)) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201051956.q05JuUiI052750>