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: <74ca2a96-978d-4d22-a787-04ceaa08aff6@stanley.mountain>
Date: Thu, 15 Aug 2024 14:20:04 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Pavitrakumar M <pavitrakumarm@...avyalabs.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
	"David S. Miller" <davem@...emloft.net>,
	shwetar <shwetar@...avyalabs.com>,
	Ruud Derwig <Ruud.Derwig@...opsys.com>,
	linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] crypto: spacc - Fix uninitialized variable in
 spacc_aead_process()

Smatch complains that:

    drivers/crypto/dwc-spacc/spacc_aead.c:1031 spacc_aead_process()
    error: uninitialized symbol 'ptaadsize'.

This could happen if, for example, tctx->mode was CRYPTO_MODE_NULL and
req->cryptlen was less than icvremove.

Fixes: 06af76b46c78 ("crypto: spacc - Add SPAcc aead support")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
 drivers/crypto/dwc-spacc/spacc_aead.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/crypto/dwc-spacc/spacc_aead.c b/drivers/crypto/dwc-spacc/spacc_aead.c
index 3468ff605957..50ef9053fc4d 100755
--- a/drivers/crypto/dwc-spacc/spacc_aead.c
+++ b/drivers/crypto/dwc-spacc/spacc_aead.c
@@ -823,7 +823,7 @@ static int spacc_aead_process(struct aead_request *req, u64 seq, int encrypt)
 	u32 dstoff;
 	int icvremove;
 	int ivaadsize;
-	int ptaadsize;
+	int ptaadsize = 0;
 	int iv_to_context;
 	int spacc_proc_len;
 	u32 spacc_icv_offset = 0;
@@ -974,8 +974,6 @@ static int spacc_aead_process(struct aead_request *req, u64 seq, int encrypt)
 	    tctx->mode == CRYPTO_MODE_NULL) {
 		if (req->cryptlen >= icvremove)
 			ptaadsize = req->cryptlen - icvremove;
-	} else {
-		ptaadsize = 0;
 	}
 
 	/* Calculate and set the below, important parameters
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ