lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CACXcFmm=eUjfVAJGgFGPfHWCc7s37j0==eASdqJK3OBAazeyOQ@mail.gmail.com>
Date:   Tue, 16 Nov 2021 19:38:06 +0800
From:   Sandy Harris <sandyinchina@...il.com>
To:     LKML <linux-kernel@...r.kernel.org>,
        Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH 7/8] Replace memset() with memzero_explicit()

Replace memset(address,0,bytes) which may be optimised
away with memzero_explicit(address,bytes) which resists
such optimisation

---
 crypto/sm2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/sm2.c b/crypto/sm2.c
index db8a4a265669..58641d964671 100644
--- a/crypto/sm2.c
+++ b/crypto/sm2.c
@@ -124,7 +124,7 @@ static void sm2_ec_ctx_deinit(struct mpi_ec_ctx *ec)
 {
     mpi_ec_deinit(ec);

-    memset(ec, 0, sizeof(*ec));
+    memzero_explicit(ec, sizeof(*ec));
 }

 /* RESULT must have been initialized and is set on success to the
--

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ