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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55D5DC97.1040209@gmail.com>
Date:	Thu, 20 Aug 2015 15:56:39 +0200
From:	Corentin LABBE <clabbe.montjoie@...il.com>
To:	Michal Suchanek <hramrach@...il.com>,
	Herbert Xu <herbert@...dor.apana.org.au>,
	"David S. Miller" <davem@...emloft.net>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-crypto@...r.kernel.org,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: un4i-ss-cipher.c warning

On 19/08/2015 16:35, Michal Suchanek wrote:
> Hello,
>
> when building a kernel with sunxi crypto driver as merged into the
> sinxi-wip branch I get a compiler warning.
>
> I am not sure this is the latest version of the driver. It does not
> seem to be in mainline yet.
>
> Thanks
>
> Michal
>
> In file included from /scratch/build/linux/include/linux/printk.h:277:0,
>                   from /scratch/build/linux/include/linux/kernel.h:13,
>                   from /scratch/build/linux/include/linux/clk.h:16,
>                   from
> /scratch/build/linux/drivers/crypto/sunxi-ss/sun4i-ss.h:15,
>                   from
> /scratch/build/linux/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:17:
> /scratch/build/linux/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c: In
> function ‘sun4i_ss_cipher_poll’:
> /scratch/build/linux/include/linux/dynamic_debug.h:86:3: warning:
> ‘todo’ may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>     __dynamic_dev_dbg(&descriptor, dev, fmt, \
>     ^
> /scratch/build/linux/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:144:15:
> note: ‘todo’ was declared here
>    unsigned int todo;
>

Hello

Thanks for the report, strange that I do not have that warning.
todo is always initialized, since oleft and ileft are always > 0 at start.
But setting todo to 0 is a simple fix.
The following patch will suppress the warning.

Regards

-- >8 --
 From 67f2d0749041b08c4c4ad671ab710b3b83f6dfd3 Mon Sep 17 00:00:00 2001
From: LABBE Corentin <clabbe.montjoie@...il.com>
Date: Thu, 20 Aug 2015 12:18:46 +0200
Subject: [PATCH] crypto: sun4i-ss: suppress the todo uninitialized warning

Signed-off-by: LABBE Corentin <clabbe.montjoie@...il.com>
---
  drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
index e070c31..9299914 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
@@ -32,7 +32,7 @@ static int sun4i_ss_opti_poll(struct ablkcipher_request *areq)
  	int i, err = 0;
  	unsigned int ileft = areq->nbytes;
  	unsigned int oleft = areq->nbytes;
-	unsigned int todo;
+	unsigned int todo = 0;
  	struct sg_mapping_iter mi, mo;
  	unsigned int oi, oo; /* offset for in and out */

@@ -141,7 +141,7 @@ static int sun4i_ss_cipher_poll(struct ablkcipher_request *areq)
  	int i, err = 0;
  	unsigned int ileft = areq->nbytes;
  	unsigned int oleft = areq->nbytes;
-	unsigned int todo;
+	unsigned int todo = 0;
  	struct sg_mapping_iter mi, mo;
  	unsigned int oi, oo;	/* offset for in and out */
  	char buf[4 * SS_RX_MAX];/* buffer for linearize SG src */
-- 
2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ