netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Prevent reading uninitialized memory with socket filters
@ 2010-11-09 23:53 Dan Rosenberg
  0 siblings, 0 replies; only message in thread
From: Dan Rosenberg @ 2010-11-09 23:53 UTC (permalink / raw)
  To: netdev; +Cc: security, stable

As requested, avoiding the memset.

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

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;



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-09 23:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09 23:53 [PATCH v2] Prevent reading uninitialized memory with socket filters Dan Rosenberg

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).