Module Name: src
Committed By: rmind
Date: Thu Sep 19 00:48:48 UTC 2013
Modified Files:
src/sys/net: bpf_filter.c
Log Message:
bpf_validate_ext: allow COP to modify the memstore.
To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/net/bpf_filter.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/bpf_filter.c
diff -u src/sys/net/bpf_filter.c:1.58 src/sys/net/bpf_filter.c:1.59
--- src/sys/net/bpf_filter.c:1.58 Wed Sep 18 23:34:55 2013
+++ src/sys/net/bpf_filter.c Thu Sep 19 00:48:48 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf_filter.c,v 1.58 2013/09/18 23:34:55 rmind Exp $ */
+/* $NetBSD: bpf_filter.c,v 1.59 2013/09/19 00:48:48 rmind Exp $ */
/*-
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.58 2013/09/18 23:34:55 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.59 2013/09/19 00:48:48 rmind Exp $");
#if 0
#if !(defined(lint) || defined(KERNEL))
@@ -729,6 +729,19 @@ bpf_validate(const struct bpf_insn *f, i
case BPF_RET:
break;
case BPF_MISC:
+#if defined(KERNEL) || defined(_KERNEL)
+ switch (BPF_MISCOP(p->code)) {
+ case BPF_COP:
+ case BPF_COPX:
+ /* In-kernel COP use only. */
+ if (bc->copfuncs) {
+ invalid = 0;
+ }
+ break;
+ default:
+ break;
+ }
+#endif
break;
default:
goto out;