DragonFlyBSD Kernel Audit
DF-0317 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/net/wg/if_wg.c b/sys/net/wg/if_wg.c
--- a/sys/net/wg/if_wg.c
+++ b/sys/net/wg/if_wg.c
@@ -1574,6 +1574,12 @@
 	 * This is global, so that the load calculation applies to the
 	 * whole system.  Don't care about races with it at all.
 	 */
+	/*
+	 * XXX This timestamp is static/shared across ALL wg interfaces and CPUs,
+	 * coupling the underload/cookie posture of interface A to attacker load on B.
+	 * The full fix is to move it into struct wg_softc (per-interface). The RMW on
+	 * the multi-word timespec is also non-atomic (author: Dont care about races).
+	 */
 	static struct timespec	last_underload; /* nanouptime */
 	struct timespec		now;
 	bool			underload;