Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net bpf_validate_ext: allow COP to modify the memstore.



details:   https://anonhg.NetBSD.org/src/rev/696e27d2d10a
branches:  trunk
changeset: 790101:696e27d2d10a
user:      rmind <rmind%NetBSD.org@localhost>
date:      Thu Sep 19 00:48:48 2013 +0000

description:
bpf_validate_ext: allow COP to modify the memstore.

diffstat:

 sys/net/bpf_filter.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r f6fd0a438117 -r 696e27d2d10a sys/net/bpf_filter.c
--- a/sys/net/bpf_filter.c      Thu Sep 19 00:34:00 2013 +0000
+++ b/sys/net/bpf_filter.c      Thu Sep 19 00:48:48 2013 +0000
@@ -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 @@
                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;



Home | Main Index | Thread Index | Old Index