Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Apr 2021 18:34:36 GMT
From:      Bernhard Froehlich <decke@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: a3bb4c38f3be - 2021Q2 - net/wireguard-kmod: Add patch to fix panic due to missing epoch tracking in transmit
Message-ID:  <202104251834.13PIYaxL016033@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2021Q2 has been updated by decke:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a3bb4c38f3be163c3bacc24efa49e853e62b717c

commit a3bb4c38f3be163c3bacc24efa49e853e62b717c
Author:     Bernhard Froehlich <decke@FreeBSD.org>
AuthorDate: 2021-04-25 18:29:29 +0000
Commit:     Bernhard Froehlich <decke@FreeBSD.org>
CommitDate: 2021-04-25 18:33:47 +0000

    net/wireguard-kmod: Add patch to fix panic due to missing epoch tracking in transmit
    
    Obtained from:  https://git.zx2c4.com/wireguard-freebsd/commit/?id=e03bf597383cef7f16c41fa4952a6b04093e9e64
    
    (cherry picked from commit 98c107c85696297c2a1ec986b3f76e67f7590771)
---
 net/wireguard-kmod/Makefile                        |  1 +
 .../patch-e03bf597383cef7f16c41fa4952a6b04093e9e64 | 52 ++++++++++++++++++++++
 2 files changed, 53 insertions(+)

diff --git a/net/wireguard-kmod/Makefile b/net/wireguard-kmod/Makefile
index 938c094e8296..e0565d48f874 100644
--- a/net/wireguard-kmod/Makefile
+++ b/net/wireguard-kmod/Makefile
@@ -1,6 +1,7 @@
 
 PORTNAME=	wireguard-kmod
 PORTVERSION=	0.0.20210424
+PORTREVISION=	1
 CATEGORIES=	net net-vpn
 MASTER_SITES=	https://git.zx2c4.com/wireguard-freebsd/snapshot/
 DISTNAME=	wireguard-freebsd-${PORTVERSION}
diff --git a/net/wireguard-kmod/files/patch-e03bf597383cef7f16c41fa4952a6b04093e9e64 b/net/wireguard-kmod/files/patch-e03bf597383cef7f16c41fa4952a6b04093e9e64
new file mode 100644
index 000000000000..1705a0f9a69f
--- /dev/null
+++ b/net/wireguard-kmod/files/patch-e03bf597383cef7f16c41fa4952a6b04093e9e64
@@ -0,0 +1,52 @@
+From e03bf597383cef7f16c41fa4952a6b04093e9e64 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Date: Sun, 25 Apr 2021 10:45:39 -0400
+Subject: if_wg: re-add epoch tracking to transmit
+
+This was accidentally removed before. We need it to work around v6 core
+bugs.
+
+Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
+---
+ src/if_wg.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/if_wg.c b/src/if_wg.c
+index 095a4f37f8dc..0c2565ce56c0 100644
+--- if_wg.c
++++ if_wg.c
+@@ -2063,6 +2063,7 @@ error:
+ static int
+ wg_transmit(struct ifnet *ifp, struct mbuf *m)
+ {
++	struct epoch_tracker	 et;
+ 	struct wg_packet	*pkt = m->m_pkthdr.PH_loc.ptr;
+ 	struct wg_softc		*sc = ifp->if_softc;
+ 	struct wg_peer		*peer;
+@@ -2070,6 +2071,7 @@ wg_transmit(struct ifnet *ifp, struct mbuf *m)
+ 	int			 rc = 0;
+ 	sa_family_t		 peer_af;
+ 
++	NET_EPOCH_ENTER(et);
+ 	/* Work around lifetime issue in the ipv6 mld code. */
+ 	if (__predict_false((ifp->if_flags & IFF_DYING) || !sc)) {
+ 		rc = ENXIO;
+@@ -2109,11 +2111,15 @@ wg_transmit(struct ifnet *ifp, struct mbuf *m)
+ 	wg_queue_push_staged(&peer->p_stage_queue, pkt);
+ 	wg_peer_send_staged(peer);
+ 	noise_remote_put(peer->p_remote);
++	NET_EPOCH_EXIT(et);
++
+ 	return (0);
+ err_peer:
+ 	noise_remote_put(peer->p_remote);
+ err:
+ 	if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
++	NET_EPOCH_EXIT(et);
++	/* TODO: send ICMP unreachable? */
+ 	wg_packet_free(pkt);
+ 	return (rc);
+ }
+-- 
+cgit v1.2.3-11-g984f
+



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