Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Nov 2020 13:52:14 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r367790 - stable/12/sys/net
Message-ID:  <202011181352.0AIDqEAY085189@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Nov 18 13:52:13 2020
New Revision: 367790
URL: https://svnweb.freebsd.org/changeset/base/367790

Log:
  MFC r367594:
    Fix possible NULL pointer dereference.
  
    lagg(4) replaces if_output method of its child interfaces and expects
    that this method can be called only by child interfaces. But it is
    possible that lagg_port_output() could be called by children of child
    interfaces. In this case ifnet's if_lagg field is NULL. Add check that
    lp is not NULL.

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

Modified: stable/12/sys/net/if_lagg.c
==============================================================================
--- stable/12/sys/net/if_lagg.c	Wed Nov 18 13:47:11 2020	(r367789)
+++ stable/12/sys/net/if_lagg.c	Wed Nov 18 13:52:13 2020	(r367790)
@@ -1033,7 +1033,8 @@ lagg_port_output(struct ifnet *ifp, struct mbuf *m,
 	switch (dst->sa_family) {
 		case pseudo_AF_HDRCMPLT:
 		case AF_UNSPEC:
-			return ((*lp->lp_output)(ifp, m, dst, ro));
+			if (lp != NULL)
+				return ((*lp->lp_output)(ifp, m, dst, ro));
 	}
 
 	/* drop any other frames */



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