Subject: [PATCH v2] Prevent reading uninitialized memory with socket filters

From: Dan Rosenberg <[email-masked]>
Date: Tue, 09 Nov 2010 18:53:37 -0500

As requested, avoiding the memset.

Signed-off-by: Dan Rosenberg <[email-masked]>

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;