From d5aac921d3276a9aded04356a0553660c1320d61 Mon Sep 17 00:00:00 2001 From: drochner Date: Thu, 14 Jul 2011 10:43:55 +0000 Subject: [PATCH] clear the packet filter's scratch memory before running the filter program, otherwise kernel memory can be leaked, from Guy Harris per PR kern/45142 --- sys/net/bpf_filter.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c index 60db15b01939..5a40855d451d 100644 --- a/sys/net/bpf_filter.c +++ b/sys/net/bpf_filter.c @@ -1,4 +1,4 @@ -/* $NetBSD: bpf_filter.c,v 1.46 2011/02/19 17:21:48 christos Exp $ */ +/* $NetBSD: bpf_filter.c,v 1.47 2011/07/14 10:43:55 drochner Exp $ */ /*- * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.46 2011/02/19 17:21:48 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.47 2011/07/14 10:43:55 drochner Exp $"); #if 0 #if !(defined(lint) || defined(KERNEL)) @@ -148,6 +148,7 @@ bpf_filter(const struct bpf_insn *pc, const u_char *p, u_int wirelen, return (u_int)-1; A = 0; X = 0; + memset(mem, 0, sizeof(mem)); --pc; for (;;) { ++pc;