From nobody Fri Nov 11 22:04:23 2022 X-Original-To: dev-commits-src-all@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 4N8CRC2DfHz4gG6X; Fri, 11 Nov 2022 22:04:23 +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 4N8CRC1kPWz3C0p; Fri, 11 Nov 2022 22:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668204263; 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=1FBqSwOA6EYgb1OgxtWMosEYYcY0xqpDf/EmmHKD+KU=; b=nANtj0UQ406GLQDXS74nVQfpu1AiOS+qJYSxakviHex/0ZbXlK3oz0XRPDRu++N2hbRIG4 kCpedCEhDJP/J+u27ZTXuKQfVxiJqRqt1dUwD0CjQKBYJUJ60mCJs+u1ztlLZb2EmeJpdV EUyW0AInAEu2mfMWNOlxnNsTrOZyhmySOTsaLTxoDTvPpMIUfiQC22vfdQjsy9ZvHqpm6s YdGz1XojVIOlKuWIAh/nWmUYnbxDw76CEgZsvziQ7Hhzds/ZA2n+pnT/+pU7GfK8+6BNR9 4W7LWtkOfVHkvrpoXCAknzmCiQ6ZBOikc6qp9obnZWJRAEgNwmPeiuOey/FxpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668204263; 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=1FBqSwOA6EYgb1OgxtWMosEYYcY0xqpDf/EmmHKD+KU=; b=jUioOfygava3IVgIncrPmbtAgIxPiVVS8VSQmcssOSS7geRNZ07uX5yJ5N8n628uKxh57r 7ZFT/9yq5VGrgHIIYqK1SoffhqVfQ+swKBzQHirXn3BU1XUdoNQN9Tk8e785t/BK/X8sG1 Ea4Dvh6lnXhNjCaepWzri5Itb7cQDyfdCckN0n+DU+DRtZjgdUzWicMbG0788/mVS6+IrC +dSlS0RZroILA291teVDw7bnaQi1tnRUQxAHn0gWwH2fur9RPD5zTXUwl29nm8x0rdWOwL h66f3z+xceDUHZY//vom29TGJ9sXgJBz5VZ+kdeEMhw1whPS6LYnQ0E30dv2mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668204263; a=rsa-sha256; cv=none; b=w2kYz6KHXw4H0qMTkQHlT9tny5yia73ZdEf9s5pEtJLGVKgBFpHmcRBA6Dz65g4i1DA5vK 7VNN/mSOFSsCyPFIekNUxG7aIiLPKE03r/hwN771HO4tlPQCK/GrwrTIji5hPy6HMPxU1w ZAHf2du7Zp8TmzVJt4PzpdGSil742fEhqWiRbTaQwRMKeLCP5dcuAJ7c7znkekbGPk6+jz Fu1ol9tWflYAkZNWNiW8rvqFAis9EHs00vOz+tYe2vagplZfjrrnmQYG53pzkJKGYDU4KE rrwKX2i8AvSBBLk4eI95EgOD1eSTJtnGSHVPQY3g36kXiHyFvWBlWJXldQYNIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N8CRC0rbXzyv8; Fri, 11 Nov 2022 22:04:23 +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 2ABM4NuR005438; Fri, 11 Nov 2022 22:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ABM4NS3005437; Fri, 11 Nov 2022 22:04:23 GMT (envelope-from git) Date: Fri, 11 Nov 2022 22:04:23 GMT Message-Id: <202211112204.2ABM4NS3005437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4c6b5076b714 - stable/13 - wg: Use zfree. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c6b5076b714c037c856f5854135c7522a63cbbc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4c6b5076b714c037c856f5854135c7522a63cbbc commit 4c6b5076b714c037c856f5854135c7522a63cbbc Author: John Baldwin AuthorDate: 2022-10-28 20:36:13 +0000 Commit: John Baldwin CommitDate: 2022-11-11 21:49:44 +0000 wg: Use zfree. Reviewed by: kevans, markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36911 (cherry picked from commit dcf581bb49bedcf9c18d6cccc80a9fbd68516d23) --- sys/dev/wg/if_wg.c | 6 ++---- sys/dev/wg/wg_noise.c | 9 +++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index acb1423ba40e..61828aa03496 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2454,8 +2454,7 @@ out_locked: sx_xunlock(&sc->sc_lock); nvlist_destroy(nvl); out: - explicit_bzero(nvlpacked, wgd->wgd_size); - free(nvlpacked, M_TEMP); + zfree(nvlpacked, M_TEMP); return (err); } @@ -2579,8 +2578,7 @@ wgc_get(struct wg_softc *sc, struct wg_data_io *wgd) wgd->wgd_size = size; out: - explicit_bzero(packed, size); - free(packed, M_NVLIST); + zfree(packed, M_NVLIST); err: nvlist_destroy(nvl); return (err); diff --git a/sys/dev/wg/wg_noise.c b/sys/dev/wg/wg_noise.c index 095da9dd4a7b..73ee712b11e9 100644 --- a/sys/dev/wg/wg_noise.c +++ b/sys/dev/wg/wg_noise.c @@ -223,8 +223,7 @@ noise_local_put(struct noise_local *l) rw_destroy(&l->l_identity_lock); mtx_destroy(&l->l_remote_mtx); mtx_destroy(&l->l_index_mtx); - explicit_bzero(l, sizeof(*l)); - free(l, M_NOISE); + zfree(l, M_NOISE); } } @@ -472,8 +471,7 @@ noise_remote_smr_free(struct epoch_context *smr) noise_local_put(r->r_local); rw_destroy(&r->r_handshake_lock); mtx_destroy(&r->r_keypair_mtx); - explicit_bzero(r, sizeof(*r)); - free(r, M_NOISE); + zfree(r, M_NOISE); } void @@ -754,8 +752,7 @@ noise_keypair_smr_free(struct epoch_context *smr) kp = __containerof(smr, struct noise_keypair, kp_smr); noise_remote_put(kp->kp_remote); rw_destroy(&kp->kp_nonce_lock); - explicit_bzero(kp, sizeof(*kp)); - free(kp, M_NOISE); + zfree(kp, M_NOISE); } void