Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 May 2021 13:23:23 GMT
From:      Tai-hwa Liang <avatar@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 5fcae416655b - stable/13 - fwip(4): fixing kernel panic when receiving unicast packet
Message-ID:  <202105061323.146DNNja047461@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by avatar:

URL: https://cgit.FreeBSD.org/src/commit/?id=5fcae416655bc66e0eefaa87f9797ff8791d8de1

commit 5fcae416655bc66e0eefaa87f9797ff8791d8de1
Author:     Tai-hwa Liang <avatar@FreeBSD.org>
AuthorDate: 2021-04-15 14:24:14 +0000
Commit:     Tai-hwa Liang <avatar@FreeBSD.org>
CommitDate: 2021-05-06 13:23:00 +0000

    fwip(4): fixing kernel panic when receiving unicast packet
    
    Wrapping fwip_unicast_input() with NET_EPOCH_{ENTER,EXIT} to avoid a
    NET_EPOCH_ASSERT() in netisr_dispatch().
    
    Reviewed by:    hselasky
    MFC after:      2 weeks
    
    (cherry picked from commit bdf316e892e9a7afa70e094135b5d05fbc26e867)
---
 sys/dev/firewire/if_fwip.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c
index 46cd56e30748..e45fd67baea7 100644
--- a/sys/dev/firewire/if_fwip.c
+++ b/sys/dev/firewire/if_fwip.c
@@ -838,6 +838,7 @@ fwip_unicast_input(struct fw_xfer *xfer)
 	uint64_t address;
 	struct mbuf *m;
 	struct m_tag *mtag;
+	struct epoch_tracker et;
 	struct ifnet *ifp;
 	struct fwip_softc *fwip;
 	struct fw_pkt *fp;
@@ -863,6 +864,7 @@ fwip_unicast_input(struct fw_xfer *xfer)
 	} else {
 		rtcode = FWRCODE_COMPLETE;
 	}
+	NET_EPOCH_ENTER(et);
 
 	/*
 	 * Pick up a new mbuf and stick it on the back of the receive
@@ -876,7 +878,7 @@ fwip_unicast_input(struct fw_xfer *xfer)
 	if (rtcode != FWRCODE_COMPLETE) {
 		m_freem(m);
 		if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
-		return;
+		goto done;
 	}
 
 	if (bpf_peers_present(ifp->if_bpf)) {
@@ -911,6 +913,8 @@ fwip_unicast_input(struct fw_xfer *xfer)
 	m->m_pkthdr.rcvif = ifp;
 	firewire_input(ifp, m, fp->mode.wreqb.src);
 	if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
+done:
+	NET_EPOCH_EXIT(et);
 }
 
 static devclass_t fwip_devclass;



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