Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Feb 2017 23:04:01 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r313112 - stable/10/sys/net
Message-ID:  <201702022304.v12N41Hr035479@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Thu Feb  2 23:04:01 2017
New Revision: 313112
URL: https://svnweb.freebsd.org/changeset/base/313112

Log:
  MFC r310180, r310327
  
  r310180:
  Fix panic during lagg destruction with simultaneous status check
  
  If you run "ifconfig lagg0 destroy" and "ifconfig lagg0" at the same time a
  page fault may result. The first process will destroy ifp->if_lagg in
  lagg_clone_destroy (called by if_clone_destroy). Then the second process
  will observe that ifp->if_lagg is NULL at the top of lagg_port_ioctl and
  goto fallback: where it will promptly dereference ifp->if_lagg anyway.
  
  The solution is to repeat the NULL check for ifp->if_lagg
  
  MFC after:	4 weeks
  Sponsored by:	Spectra Logic Corp
  Differential Revision:	https://reviews.freebsd.org/D8512
  
  r310327:
  Remove stray debugging code from r310180
  
  Reported by:	rstone
  Pointy hat to:	asomers
  MFC after:	3 weeks
  X-MFC-with:	310180
  Sponsored by:	Spectra Logic Corp

Modified:
  stable/10/sys/net/if_lagg.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/if_lagg.c
==============================================================================
--- stable/10/sys/net/if_lagg.c	Thu Feb  2 23:04:00 2017	(r313111)
+++ stable/10/sys/net/if_lagg.c	Thu Feb  2 23:04:01 2017	(r313112)
@@ -858,7 +858,7 @@ lagg_port_ioctl(struct ifnet *ifp, u_lon
 	return (error);
 
 fallback:
-	if (lp->lp_ioctl != NULL)
+	if (lp != NULL && lp->lp_ioctl != NULL)
 		return ((*lp->lp_ioctl)(ifp, cmd, data));
 
 	return (EINVAL);



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