diff mbox

[v2] Prevent reading uninitialized memory with socket filters

Message ID 1289346817.7380.16.camel@dan
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Dan Rosenberg Nov. 9, 2010, 11:53 p.m. UTC
As requested, avoiding the memset.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff -urp a/net/core/filter.c b/net/core/filter.c
--- a/net/core/filter.c	2010-11-08 22:10:26.820703471 -0500
+++ b/net/core/filter.c	2010-11-09 18:49:33.857201963 -0500
@@ -116,7 +116,7 @@  unsigned int sk_run_filter(struct sk_buf
 	void *ptr;
 	u32 A = 0;			/* Accumulator */
 	u32 X = 0;			/* Index Register */
-	u32 mem[BPF_MEMWORDS];		/* Scratch Memory Store */
+	u32 mem[BPF_MEMWORDS] = {};	/* Scratch Memory Store */
 	u32 tmp;
 	int k;
 	int pc;