All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: crypto: fix Using uninitialized value walk.flags
@ 2022-04-10  6:07 chinayanlei2002
  2022-04-18 19:30 ` Eric Biggers
  0 siblings, 1 reply; 2+ messages in thread
From: chinayanlei2002 @ 2022-04-10  6:07 UTC (permalink / raw)
  To: herbert, tglx, mingo, bp, dave.hansen; +Cc: linux-crypto, Yan Lei

From: Yan Lei <yan_lei@dahuatech.com>

----------------------------------------------------------
Using uninitialized value "walk.flags" when calling "skcipher_walk_virt".

Signed-off-by: Yan Lei <yan_lei@dahuatech.com>
---
 arch/x86/crypto/sm4_aesni_avx_glue.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/crypto/sm4_aesni_avx_glue.c b/arch/x86/crypto/sm4_aesni_avx_glue.c
index 7800f77d6..417e3bbfe 100644
--- a/arch/x86/crypto/sm4_aesni_avx_glue.c
+++ b/arch/x86/crypto/sm4_aesni_avx_glue.c
@@ -40,7 +40,7 @@ static int sm4_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
 
 static int ecb_do_crypt(struct skcipher_request *req, const u32 *rkey)
 {
-	struct skcipher_walk walk;
+	struct skcipher_walk walk = { 0 };
 	unsigned int nbytes;
 	int err;
 
@@ -94,7 +94,7 @@ int sm4_cbc_encrypt(struct skcipher_request *req)
 {
 	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
 	struct sm4_ctx *ctx = crypto_skcipher_ctx(tfm);
-	struct skcipher_walk walk;
+	struct skcipher_walk walk = { 0 };
 	unsigned int nbytes;
 	int err;
 
@@ -128,7 +128,7 @@ int sm4_avx_cbc_decrypt(struct skcipher_request *req,
 {
 	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
 	struct sm4_ctx *ctx = crypto_skcipher_ctx(tfm);
-	struct skcipher_walk walk;
+	struct skcipher_walk walk = { 0 };
 	unsigned int nbytes;
 	int err;
 
@@ -192,7 +192,7 @@ int sm4_cfb_encrypt(struct skcipher_request *req)
 {
 	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
 	struct sm4_ctx *ctx = crypto_skcipher_ctx(tfm);
-	struct skcipher_walk walk;
+	struct skcipher_walk walk = { 0 };
 	unsigned int nbytes;
 	int err;
 
@@ -234,7 +234,7 @@ int sm4_avx_cfb_decrypt(struct skcipher_request *req,
 {
 	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
 	struct sm4_ctx *ctx = crypto_skcipher_ctx(tfm);
-	struct skcipher_walk walk;
+	struct skcipher_walk walk = { 0 };
 	unsigned int nbytes;
 	int err;
 
@@ -303,7 +303,7 @@ int sm4_avx_ctr_crypt(struct skcipher_request *req,
 {
 	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
 	struct sm4_ctx *ctx = crypto_skcipher_ctx(tfm);
-	struct skcipher_walk walk;
+	struct skcipher_walk walk = { 0 };
 	unsigned int nbytes;
 	int err;
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-18 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-10  6:07 [PATCH] x86: crypto: fix Using uninitialized value walk.flags chinayanlei2002
2022-04-18 19:30 ` Eric Biggers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.