Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Mar 2019 09:21:31 +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: r345256 - stable/12/sys/netpfil/ipfw/nat64
Message-ID:  <201903180921.x2I9LVfK098230@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon Mar 18 09:21:30 2019
New Revision: 345256
URL: https://svnweb.freebsd.org/changeset/base/345256

Log:
  MFC r345003:
    Add NULL pointer check to nat64_output().
  
    It is possible that a processed packet was originated by local host,
    in this case m->m_pkthdr.rcvif is NULL. Check and set it to V_loif to
    avoid NULL pointer dereference in IP input code, since it is expected
    that packet has valid receiving interface when netisr processes it.
  
    Obtained from:	Yandex LLC
    Sponsored by:	Yandex LLC

Modified:
  stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c
==============================================================================
--- stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c	Mon Mar 18 05:03:55 2019	(r345255)
+++ stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c	Mon Mar 18 09:21:30 2019	(r345256)
@@ -219,6 +219,8 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, struct
 	}
 	if (logdata != NULL)
 		nat64_log(logdata, m, af);
+	if (m->m_pkthdr.rcvif == NULL)
+		m->m_pkthdr.rcvif = V_loif;
 	ret = netisr_queue(ret, m);
 	if (ret != 0)
 		NAT64STAT_INC(stats, oerrors);



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