[Bug 257067] panic: Assertion in_epoch(net_epoch_preempt) failed at /usr/src/sys/net/if_vlan.c:1185

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 09 Jul 2021 08:27:46 +0000
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257067

Aleksandr Fedorov <afedorov_at_FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |afedorov_at_FreeBSD.org,
                   |                            |donner_at_FreeBSD.org,
                   |                            |glebius_at_FreeBSD.org,
                   |                            |markj_at_FreeBSD.org

--- Comment #1 from Aleksandr Fedorov <afedorov_at_FreeBSD.org> ---
I think this is a bug in the ng_ppoe(4) code. Disconnecting hooks are called
outside of NET_EPOCH, but ng_pppoe_disconnect() calls NG_SEND_DATA_ONLY() which
should be called in NET_EPOCH.

Please try the following patch:

diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c
index 295a136cc55..e07f77b9d54 100644
--- a/sys/netgraph/ng_pppoe.c
+++ b/sys/netgraph/ng_pppoe.c
_at__at_ -2037,6 +2037,7 _at__at_ ng_pppoe_disconnect(hook_p hook)
                                log(LOG_NOTICE, "ng_pppoe[%x]: session out of "
                                    "mbufs\n", node->nd_ID);
                        else {
+                               struct epoch_tracker et;
                                struct pppoe_full_hdr *wh;
                                struct pppoe_tag *tag;
                                int     msglen = strlen(SIGNOFF);
_at__at_ -2067,8 +2068,11 _at__at_ ng_pppoe_disconnect(hook_p hook)
                                m->m_pkthdr.len = m->m_len = sizeof(*wh) +
sizeof(*tag) +
                                    msglen;
                                wh->ph.length = htons(sizeof(*tag) + msglen);
+
+                               NET_EPOCH_ENTER(et);
                                NG_SEND_DATA_ONLY(error,
                                        privp->ethernet_hook, m);
+                               NET_EPOCH_EXIT(et);
                        }
                }
                if (sp->state == PPPOE_LISTENING)

-- 
You are receiving this mail because:
You are the assignee for the bug.
Received on Fri Jul 09 2021 - 08:27:46 UTC

Original text of this message