From owner-svn-src-all@freebsd.org Thu Jun 25 20:20:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47A93344562; Thu, 25 Jun 2020 20:20:24 +0000 (UTC) (envelope-from jhb@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49tBGJ18cCz4Xqj; Thu, 25 Jun 2020 20:20:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22CDD8D23; Thu, 25 Jun 2020 20:20:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05PKKN4q002861; Thu, 25 Jun 2020 20:20:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05PKKNcZ002853; Thu, 25 Jun 2020 20:20:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202006252020.05PKKNcZ002853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 25 Jun 2020 20:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362626 - in head/sys: crypto/armv8 crypto/via dev/glxsb geom/eli X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: crypto/armv8 crypto/via dev/glxsb geom/eli X-SVN-Commit-Revision: 362626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 20:20:24 -0000 Author: jhb Date: Thu Jun 25 20:20:22 2020 New Revision: 362626 URL: https://svnweb.freebsd.org/changeset/base/362626 Log: Use zfree() instead of bzero() and free(). These bzero's should have been explicit_bzero's. Reviewed by: cem, delphij Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D25437 Modified: head/sys/crypto/armv8/armv8_crypto.c head/sys/crypto/via/padlock_hash.c head/sys/dev/glxsb/glxsb_hash.c head/sys/geom/eli/g_eli.c Modified: head/sys/crypto/armv8/armv8_crypto.c ============================================================================== --- head/sys/crypto/armv8/armv8_crypto.c Thu Jun 25 20:18:55 2020 (r362625) +++ head/sys/crypto/armv8/armv8_crypto.c Thu Jun 25 20:20:22 2020 (r362626) @@ -357,10 +357,8 @@ armv8_crypto_cipher_process(struct armv8_crypto_sessio fpu_kern_leave(curthread, ctx); RELEASE_CTX(i, ctx); } - if (allocated) { - bzero(buf, crp->crp_payload_length); - free(buf, M_ARMV8_CRYPTO); - } + if (allocated) + zfree(buf, M_ARMV8_CRYPTO); return (0); } Modified: head/sys/crypto/via/padlock_hash.c ============================================================================== --- head/sys/crypto/via/padlock_hash.c Thu Jun 25 20:18:55 2020 (r362625) +++ head/sys/crypto/via/padlock_hash.c Thu Jun 25 20:20:22 2020 (r362626) @@ -199,8 +199,7 @@ padlock_sha_free(void *vctx) ctx = vctx; if (ctx->psc_buf != NULL) { - //bzero(ctx->psc_buf, ctx->psc_size); - free(ctx->psc_buf, M_PADLOCK); + zfree(ctx->psc_buf, M_PADLOCK); ctx->psc_buf = NULL; ctx->psc_offset = 0; ctx->psc_size = 0; @@ -415,14 +414,12 @@ padlock_hash_free(struct padlock_session *ses) if (ses->ses_ictx != NULL) { padlock_free_ctx(ses->ses_axf, ses->ses_ictx); - bzero(ses->ses_ictx, ses->ses_axf->ctxsize); - free(ses->ses_ictx, M_PADLOCK); + zfree(ses->ses_ictx, M_PADLOCK); ses->ses_ictx = NULL; } if (ses->ses_octx != NULL) { padlock_free_ctx(ses->ses_axf, ses->ses_octx); - bzero(ses->ses_octx, ses->ses_axf->ctxsize); - free(ses->ses_octx, M_PADLOCK); + zfree(ses->ses_octx, M_PADLOCK); ses->ses_octx = NULL; } } Modified: head/sys/dev/glxsb/glxsb_hash.c ============================================================================== --- head/sys/dev/glxsb/glxsb_hash.c Thu Jun 25 20:18:55 2020 (r362625) +++ head/sys/dev/glxsb/glxsb_hash.c Thu Jun 25 20:20:22 2020 (r362626) @@ -145,13 +145,11 @@ glxsb_hash_free(struct glxsb_session *ses) { if (ses->ses_ictx != NULL) { - bzero(ses->ses_ictx, ses->ses_axf->ctxsize); - free(ses->ses_ictx, M_GLXSB); + zfree(ses->ses_ictx, M_GLXSB); ses->ses_ictx = NULL; } if (ses->ses_octx != NULL) { - bzero(ses->ses_octx, ses->ses_axf->ctxsize); - free(ses->ses_octx, M_GLXSB); + zfree(ses->ses_octx, M_GLXSB); ses->ses_octx = NULL; } } Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Thu Jun 25 20:18:55 2020 (r362625) +++ head/sys/geom/eli/g_eli.c Thu Jun 25 20:20:22 2020 (r362626) @@ -1005,8 +1005,7 @@ failed: g_destroy_consumer(cp); g_destroy_geom(gp); g_eli_key_destroy(sc); - bzero(sc, sizeof(*sc)); - free(sc, M_ELI); + zfree(sc, M_ELI); return (NULL); } @@ -1049,8 +1048,7 @@ g_eli_destroy(struct g_eli_softc *sc, boolean_t force) mtx_destroy(&sc->sc_queue_mtx); gp->softc = NULL; g_eli_key_destroy(sc); - bzero(sc, sizeof(*sc)); - free(sc, M_ELI); + zfree(sc, M_ELI); G_ELI_DEBUG(0, "Device %s destroyed.", gp->name); g_wither_geom_close(gp, ENXIO);