From nobody Mon Jan 22 16:23:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TJb9y3HC9z57k54; Mon, 22 Jan 2024 16:23:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TJb9y2psGz4TWw; Mon, 22 Jan 2024 16:23:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705940598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UEIaP0R/JUz9BY+FX86TFZE9V1Tyb+BZ+HBGaHGBKSY=; b=reQETbBd8TJpuEPdvRkPUfWllehqazuWAg28Y4o/U1E3FHO4viK5yJt36LL2TNbHzccbYg rb0kl4U8TIV+3OlMjDXDHZ6jrT4RNxvzTJdVwXCfkJ7Vq4FPNYZQKv4Tzg/yYV3L8Tz+aX NpA2AU6j6RDU0trnEooq08qJyXMQus9iKu+qd6RGFjGgH+GoXUNeQ+nmGUazSgkJnJ6fdf ozx2HTwm30neJNH+h5spunA01hsh/QjrTjFo0P0isxGGTRTYQBSy3YIHlUs+ty5OAhN3wQ xx+sgXhNVke4+gdjgadelHzcr5IGWMBH3cB8Vp7tN0fnukbIchVAGqd+WCKZhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705940598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UEIaP0R/JUz9BY+FX86TFZE9V1Tyb+BZ+HBGaHGBKSY=; b=CFFTqQbSPHPXP8KMCV8Pnv+uP8PweTf8IVj4hRWfv5LHOQ52RkKusECx0S9oy7ztSUW00s J1TM0Sahnn48LyyC+4CQfQBlkrv72pLfhLnXnpyzkFsqYAikrSmogRCDFkeK7oDWrL8/sQ jvhT1l9BnrXEzILJq75y2aiUYajHlL1V6uEaR5GINsAwEOjqGM2ABYui9oPV4tU+t4Q2Xo aeY81joA4Jp077DISm8VNkATZl5TQ7xUIqPwYRjSyCJQ7AHSC4wjoAiWubJInvqnAn2agR Refk8V/Lmdto9qh7CkRVSR2o72nwZnd5jlxv62aeXIAbyt23YxLNrEuKMHYVEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705940598; a=rsa-sha256; cv=none; b=KpjPFsAkLW/qkKgTJpdU4ywfZ9ZH5f0OrB4kisQptrS66EgrjCBT6pJOcd/CCzMuLcb2vv omxDWuZg1bcKb9YWVuH0MeIpk7v0SjITgUYj/0/IR01+fhhIZBKF9Aqs4Onz57QyvJoBDV MbP/WLW0HWzVIVSKSr/T92GP0tfRkMcPdP6iJHkMf1/rRUWFuWb/EMekEbtRpEmsGru/nm GtL3z1/cSdHuqXc9leKOvfoYbQrtYUhsQXxXwfoS6PTuLa/bkHOWzded8+EQjk/mGXtmrl u4CUfutMjtTPZDRz6YSLgp81RDfeYrdzJ0KOXNPKvw7EjuWm//dKwNSmk50Xcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TJb9y1tFLz18Gc; Mon, 22 Jan 2024 16:23:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40MGNI7I002558; Mon, 22 Jan 2024 16:23:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40MGNIo7002555; Mon, 22 Jan 2024 16:23:18 GMT (envelope-from git) Date: Mon, 22 Jan 2024 16:23:18 GMT Message-Id: <202401221623.40MGNIo7002555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 43be2d7aaf25 - main - wg: detach bpf upon destroy as well List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43be2d7aaf25b719aec8f49aab110c0061f1edec Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=43be2d7aaf25b719aec8f49aab110c0061f1edec commit 43be2d7aaf25b719aec8f49aab110c0061f1edec Author: Aaron LI AuthorDate: 2024-01-22 16:18:56 +0000 Commit: Kyle Evans CommitDate: 2024-01-22 16:22:44 +0000 wg: detach bpf upon destroy as well bpfattach() is called in wg_clone_create(), but the bpfdetach() is missing from wg_close_destroy(). Add the missing bpfdetach() to avoid leaking both the associated bpf bits as well as the ifnet that bpf will hold a reference to. PR: 276526 MFC after: 3 days --- sys/dev/wg/if_wg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 58c0e2db1ee8..c7649e2b4059 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2876,6 +2876,7 @@ wg_clone_destroy(struct if_clone *ifc, if_t ifp, uint32_t flags) if (cred != NULL) crfree(cred); + bpfdetach(sc->sc_ifp); if_detach(sc->sc_ifp); if_free(sc->sc_ifp);