From nobody Tue Jan 30 05:39:20 2024 X-Original-To: dev-commits-src-branches@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 4TPDWD41stz58L3F; Tue, 30 Jan 2024 05:39:20 +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 4TPDWD39hxz4Wfk; Tue, 30 Jan 2024 05:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706593160; 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=2Lqgg8J3Uuyv0xHiEGBFIsnDy2y9JR1C9T7K/qtdXlI=; b=wOKOUw9i7BIADdKdkJhRJHBvLD/weVfLLVgzforxgJbd4UMv13CVGkW07xbaZwu5jmITf0 /Ku/GUPF8bqd5Q3qOrtTs7Y8winzEc8eraiuXC9/Wmy/DVoHXDhlaBEUcJJqbJ2oTH0Ijn C2WLrRS+nxzA0Gsit+69zUr8loc+Wr5N/w1LE/b6P0VbB7jNxzlPUm7N+Z/ZMWuemABSEp qw96Uhu/sXh3hV2SMD804cCfFczi/PducmxLBPRBbc0iS7rIUhq8gyjvIvJ165w/XEDtPl Wdr2w2mQHdBFbUY8iqFKPgTaOwOoqtPLfQYLcRNX6KQEvR4e87oBSoduZ5bCyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706593160; 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=2Lqgg8J3Uuyv0xHiEGBFIsnDy2y9JR1C9T7K/qtdXlI=; b=rysWmL2baoIMJJk2ko56ewmIIZvIev1F7qkrX45+WCtP4MDsDKj6kiuOoJVzJdmw+DwiGT P/4HAG2xancuTv7EbvbR6cKCJM9ub+BYj6kXZLpvlhB4rZlg2xAdUSW+TinNDK53r+WayW U20IMPzgTPxnOWnOKtdFm+rTQmlIqcI7rmKJsD1ssSct8cViB146eLD5qYPnNbtJD6lVzs MDcctrZXcLW4DyVjLEkHns/jaQSW0kbeWjhptzEhViHR5JxDIuSKRwE+6X2PLn+StUSDLx o26ryxe5A6lnMMl8LK7276hEF1UMjjxIJoRr6nVhifoeUnjEedPU9Mfo3Ym/yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706593160; a=rsa-sha256; cv=none; b=I7fNmCB3zqGskXRFjeOogL3xDU4Hw/U4okZL+g00g1XgSuEcUzrDS80RTAS19cgy7ErFrq rcUSJdtdKsnRRj/f2ABmTzVxxVNKKFi2rDebS3gogx7qwjp+iruUX2f0iscYQB4L9ELuNH E24w9rvIU18++XG48hfRZ4rcWgJtrPeLO9Vo/R3yIsWGawmkDk02VlrI9eoiAqFSkxAV2d QANFYqJEy6G9tNYaAOwsHA9YXwQv5nnuKClESe9KtPJmKLY5x54c4VP8fnfgM5rKTfrcgj jg5yNaYrbBo7fv5uuvjrOq217keJUy6WKyxzTxWzjFgXJKWuMiVLeezyAQaAmw== 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 4TPDWD2F9bzNfD; Tue, 30 Jan 2024 05:39:20 +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 40U5dK5G019095; Tue, 30 Jan 2024 05:39:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40U5dK0x019092; Tue, 30 Jan 2024 05:39:20 GMT (envelope-from git) Date: Tue, 30 Jan 2024 05:39:20 GMT Message-Id: <202401300539.40U5dK0x019092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 3deeb70f7f70 - stable/13 - wg: detach bpf upon destroy as well List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3deeb70f7f70e5fbabde85efc7ea603cde915f6a Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3deeb70f7f70e5fbabde85efc7ea603cde915f6a commit 3deeb70f7f70e5fbabde85efc7ea603cde915f6a Author: Aaron LI AuthorDate: 2024-01-22 16:18:56 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 05:38:01 +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 (cherry picked from commit 43be2d7aaf25b719aec8f49aab110c0061f1edec) --- 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 e961c9f24d94..89b5e52b7b2b 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, struct ifnet *ifp, uint32_t flags) if (cred != NULL) crfree(cred); + bpfdetach(sc->sc_ifp); if_detach(sc->sc_ifp); if_free(sc->sc_ifp);