From: sthen Date: Thu, 5 Aug 2021 13:37:04 +0000 (+0000) Subject: m_freem in wg_send's path where a peer has no endpoint address, X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2f84ac1381d01579f2b25c83b3dec5f908503765;p=openbsd m_freem in wg_send's path where a peer has no endpoint address, fixing an mbuf leak way with wgpka (keepalive) found the hard way by Matt P. Diff from Matt Dunwoodie, ok claudio@ --- diff --git a/sys/net/if_wg.c b/sys/net/if_wg.c index 18333eda4cb..bab21d96c74 100644 --- a/sys/net/if_wg.c +++ b/sys/net/if_wg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wg.c,v 1.17 2021/05/16 15:10:20 deraadt Exp $ */ +/* $OpenBSD: if_wg.c,v 1.18 2021/08/05 13:37:04 sthen Exp $ */ /* * Copyright (C) 2015-2020 Jason A. Donenfeld . All Rights Reserved. @@ -810,6 +810,7 @@ wg_send(struct wg_softc *sc, struct wg_endpoint *e, struct mbuf *m) IPPROTO_IPV6); #endif } else { + m_freem(m); return EAFNOSUPPORT; }