From nobody Wed Sep 21 19:45:19 2022 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 4MXpmJ1ZhWz4c7yp; Wed, 21 Sep 2022 19:45: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 4MXpmJ0Swhz3h3b; Wed, 21 Sep 2022 19:45:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663789520; 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=eWULJr1nqo9AN6HY5F0siQwP76wEOMC8VONgK1BXz1E=; b=RC7Qp8OEOG+u6J6dg6OWsUwm6nQJe6C8i9+xvbFvScGj0NimXKyWTmyAkIkCX720oadWti Jurmp7x2Z8alxjTBiRmQyhraF6SMfcCJZaQuc8PL9aTbn01XJHu5P2MURHlz5e1AgKuln4 sjekmTI5o4odXQkvbgHXwcxKkPspIkOis1CopjcgIzFz7Q64c36adedTO+kHgIGPSvxbr+ IvQwbFIQt87bDUpalyGdscXNLJAeyIZnREP0kWFTUYqbES27WTIMWrXpM8+QwUbRfQeNuP Yv37eFGMhr1oWVkpU2yS1mxs6vptVX0G9dW6ex94vLQolfsxCqkFrRKvB1S5Vw== 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 4MXpmH6dslz191H; Wed, 21 Sep 2022 19:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28LJjJCB024603; Wed, 21 Sep 2022 19:45:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28LJjJ6Q024602; Wed, 21 Sep 2022 19:45:19 GMT (envelope-from git) Date: Wed, 21 Sep 2022 19:45:19 GMT Message-Id: <202209211945.28LJjJ6Q024602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: d99d59a79f29 - main - if_ovpn: fix memory leak on unload 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d99d59a79f29613593e3a817d59b321550114a25 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663789520; 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=eWULJr1nqo9AN6HY5F0siQwP76wEOMC8VONgK1BXz1E=; b=w3UcE1cb5hSebnbKdhMeg+XXNlzNo6OKL6WfI8HsvrYtDil69NHiLtOydeOqeeqSphPqMS UR88I6tJOl7mzmB6VbLI1iZg5SJqaXBKYWvhb8A153egL041sndDG+5HiJHi0HDk12knRE JJkcneSZH3ITNzC3neWCYvB5pJZgOGaKvIaWQwhAx+JVhYD4kbyM7lMUwq6+vGLGZOFSWL qzYUGifOCvXHHEZPTca9mJpXlzVSmbq5nYinQNgwGuOOAry1h3i94j13YWwvSSyK5uRElQ Je3ghvODUrdwwX/Yp/MaWKGFWJslJ5YUn5fLSTCwDLa8FCCZ4dqsQd3KpEDyDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663789520; a=rsa-sha256; cv=none; b=bc5KL/E+5ydcCKoBFV6PR61qMqv6rlOz7rH7CCoa2grvxzQzU2yY8TO9MlDVxX2Xb9ux5D M1kU0JniZULyZai6jfAxJWkLxpZN4FfD/tASzdkdvC7wwsBmWazVpnXUJK9VwaPoXiRYP4 ukGisTe2wU+t1Kg3dzP9kpJG2ZOmSGpkpMhptCbbKkZ52uq+O6O1WhIPI9F1EtIcwFdB3R X/fsiTCCxmyUq43UmhqA0mLdm8w8gsaMgcDx8FojDV52wPcqcAlpQ01RagchKMHTuGHfuW 721e/O1joxefoOmNtosAF62HsCbZu/YQoy8CAdAQwySDaeNh6wiDyF1fyVsCXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d99d59a79f29613593e3a817d59b321550114a25 commit d99d59a79f29613593e3a817d59b321550114a25 Author: Kristof Provost AuthorDate: 2022-09-21 15:23:51 +0000 Commit: Kristof Provost CommitDate: 2022-09-21 19:44:59 +0000 if_ovpn: fix memory leak on unload When we're unloading the if_ovpn module we sometimes end up only freeing the softc after the module is unloaded and the M_OVPN malloc type no longer exists. Don't return from ovpn_clone_destroy() until the epoch callbacks have been called, which ensures that we've freed the softc before we destroy M_OVPN. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/if_ovpn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index e2b8322d6df5..82e6dd4f6eee 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -2421,6 +2421,8 @@ ovpn_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) if (unit != IF_DUNIT_NONE) ifc_free_unit(ifc, unit); + NET_EPOCH_DRAIN_CALLBACKS(); + return (0); }