linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sha: prevent removal of memset as dead store in sha1_update()
@ 2010-02-25 15:10 Roel Kluin
  2010-02-25 15:17 ` David Miller
  2010-02-25 15:56 ` Mikael Pettersson
  0 siblings, 2 replies; 18+ messages in thread
From: Roel Kluin @ 2010-02-25 15:10 UTC (permalink / raw)
  To: Herbert Xu, Mikael Pettersson, David S. Miller, linux-crypto,
	Andrew Morton

Due to optimization A call to memset() may be removed as a dead store when
the buffer is not used after its value is overwritten.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
see http://cwe.mitre.org/data/slices/2000.html#14

checkpatch.pl, compile and sparse tested. Comments?

diff --git a/crypto/sha1_generic.c b/crypto/sha1_generic.c
index 0416091..86de0da 100644
--- a/crypto/sha1_generic.c
+++ b/crypto/sha1_generic.c
@@ -49,8 +49,8 @@ static int sha1_update(struct shash_desc *desc, const u8 *data,
 	src = data;
 
 	if ((partial + len) > 63) {
-		u32 temp[SHA_WORKSPACE_WORDS];

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

end of thread, other threads:[~2010-02-26 15:55 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-25 15:10 [PATCH] sha: prevent removal of memset as dead store in sha1_update() Roel Kluin
2010-02-25 15:17 ` David Miller
2010-02-25 15:31   ` roel kluin
2010-02-25 15:37     ` David Miller
2010-02-26 11:55     ` Andi Kleen
2010-02-26 14:20       ` Mikael Pettersson
2010-02-26 15:46         ` Mikael Pettersson
2010-02-26 15:55           ` Andi Kleen
2010-02-25 15:56 ` Mikael Pettersson
2010-02-25 16:16   ` Pekka Enberg
2010-02-25 16:29     ` Mikael Pettersson
2010-02-25 16:33     ` roel kluin
2010-02-25 17:06       ` roel kluin
2010-02-25 16:33   ` Brian Gerst
2010-02-25 17:09     ` Mikael Pettersson
2010-02-25 17:32       ` Brian Gerst
2010-02-25 19:47         ` Roel Kluin
2010-02-25 20:43           ` Roel Kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).