All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] chcr: ensure cntrl is initialized to fix bit-wise or'ing of garabage data
@ 2017-11-30 14:23 Colin King
  2017-12-11 11:46   ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2017-11-30 14:23 UTC (permalink / raw)
  To: Harsh Jain, Herbert Xu, David S . Miller, linux-crypto
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

In the case where skb->ip_summed != CHECKSUM_PARTIAL then cntrl contains
garbage value and this is possibly being bit-wise or'd and stored into
cpl->ctrl1.  Fix this by initializing cntrl to zero.

Cleans up clang warning:
drivers/crypto/chelsio/chcr_ipsec.c:374:9: warning: The left expression
of the compound assignment is an uninitialized value. The computed value
will also be garbage

Fixes: 6dad4e8ab3ec ("chcr: Add support for Inline IPSec")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/crypto/chelsio/chcr_ipsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/chelsio/chcr_ipsec.c b/drivers/crypto/chelsio/chcr_ipsec.c
index a0f003ffd1f4..64a030f8fb21 100644
--- a/drivers/crypto/chelsio/chcr_ipsec.c
+++ b/drivers/crypto/chelsio/chcr_ipsec.c
@@ -350,7 +350,7 @@ inline void *copy_cpltx_pktxt(struct sk_buff *skb,
 	struct port_info *pi;
 	struct sge_eth_txq *q;
 	struct cpl_tx_pkt_core *cpl;
-	u64 cntrl;
+	u64 cntrl = 0;
 	u32 ctrl0, qidx;
 
 	pi = netdev_priv(dev);
-- 
2.14.1

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

* Re: [PATCH] chcr: ensure cntrl is initialized to fix bit-wise or'ing of garabage data
  2017-11-30 14:23 [PATCH] chcr: ensure cntrl is initialized to fix bit-wise or'ing of garabage data Colin King
@ 2017-12-11 11:46   ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2017-12-11 11:46 UTC (permalink / raw)
  To: Colin King
  Cc: Harsh Jain, David S . Miller, linux-crypto, kernel-janitors,
	linux-kernel

On Thu, Nov 30, 2017 at 02:23:54PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where skb->ip_summed != CHECKSUM_PARTIAL then cntrl contains
> garbage value and this is possibly being bit-wise or'd and stored into
> cpl->ctrl1.  Fix this by initializing cntrl to zero.
> 
> Cleans up clang warning:
> drivers/crypto/chelsio/chcr_ipsec.c:374:9: warning: The left expression
> of the compound assignment is an uninitialized value. The computed value
> will also be garbage
> 
> Fixes: 6dad4e8ab3ec ("chcr: Add support for Inline IPSec")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH] chcr: ensure cntrl is initialized to fix bit-wise or'ing of garabage data
@ 2017-12-11 11:46   ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2017-12-11 11:46 UTC (permalink / raw)
  To: Colin King
  Cc: Harsh Jain, David S . Miller, linux-crypto, kernel-janitors,
	linux-kernel

On Thu, Nov 30, 2017 at 02:23:54PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where skb->ip_summed != CHECKSUM_PARTIAL then cntrl contains
> garbage value and this is possibly being bit-wise or'd and stored into
> cpl->ctrl1.  Fix this by initializing cntrl to zero.
> 
> Cleans up clang warning:
> drivers/crypto/chelsio/chcr_ipsec.c:374:9: warning: The left expression
> of the compound assignment is an uninitialized value. The computed value
> will also be garbage
> 
> Fixes: 6dad4e8ab3ec ("chcr: Add support for Inline IPSec")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2017-12-11 11:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30 14:23 [PATCH] chcr: ensure cntrl is initialized to fix bit-wise or'ing of garabage data Colin King
2017-12-11 11:46 ` Herbert Xu
2017-12-11 11:46   ` Herbert Xu

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.