Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:05:53 -0000
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r345683 - stable/11/sys/net
Message-ID:  <201903291159.x2TBxsJb065072@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Fri Mar 29 11:59:54 2019
New Revision: 345683
URL: https://svnweb.freebsd.org/changeset/base/345683

Log:
  MFC r345178:
  
  bridge: Fix panic if the STP root is removed
  
  If the spanning tree root interface is removed from the bridge we panic
  on the next 'ifconfig'.
  While the STP code is notified whenever a bridge member interface is
  removed from the bridge it does not clear the bs_root_port. This means
  bs_root_port can still point at an bridge_iflist which has been free()d.
  The next access to it will panic.
  
  Explicitly check if the interface we're removing in bstp_destroy() is
  the root, and if so re-assign the roles, which clears bs_root_port.
  
  Reviewed by:	philip

Modified:
  stable/11/sys/net/bridgestp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/net/bridgestp.c
==============================================================================
--- stable/11/sys/net/bridgestp.c	Fri Mar 29 11:59:53 2019	(r345682)
+++ stable/11/sys/net/bridgestp.c	Fri Mar 29 11:59:54 2019	(r345683)
@@ -2271,4 +2271,7 @@ bstp_destroy(struct bstp_port *bp)
 	taskqueue_drain(taskqueue_swi, &bp->bp_statetask);
 	taskqueue_drain(taskqueue_swi, &bp->bp_rtagetask);
 	taskqueue_drain(taskqueue_swi, &bp->bp_mediatask);
+
+	if (bp->bp_bs->bs_root_port == bp)
+		bstp_assign_roles(bp->bp_bs);
 }





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