Source-Changes-HG archive

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

[src/trunk]: src Fix for PR kern/48109 (and its duplicate kern/49807)



details:   https://anonhg.NetBSD.org/src/rev/e1965789f95b
branches:  trunk
changeset: 337094:e1965789f95b
user:      khorben <khorben%NetBSD.org@localhost>
date:      Thu Apr 02 00:12:58 2015 +0000

description:
Fix for PR kern/48109 (and its duplicate kern/49807)

As provided by Takahiro HAYASHI in PR kern/48109. Additional error
registration in ipf(8) by myself. Changes tested with GENERIC and
XEN3_DOM0. Thanks!

XXX pull-up netbsd-7

diffstat:

 external/bsd/ipf/dist/lib/interror.c |  5 +++--
 sys/external/bsd/ipf/netinet/fil.c   |  9 +++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (56 lines):

diff -r a40be3b7967f -r e1965789f95b external/bsd/ipf/dist/lib/interror.c
--- a/external/bsd/ipf/dist/lib/interror.c      Wed Apr 01 23:31:37 2015 +0000
+++ b/external/bsd/ipf/dist/lib/interror.c      Thu Apr 02 00:12:58 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interror.c,v 1.3 2013/05/08 18:20:14 christos Exp $    */
+/*     $NetBSD: interror.c,v 1.4 2015/04/02 00:12:58 khorben Exp $     */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -19,7 +19,7 @@
 
 static ipf_error_entry_t *find_error __P((int));
 
-#define        IPF_NUM_ERRORS  475
+#define        IPF_NUM_ERRORS  476
 
 /*
  * NO REUSE OF NUMBERS!
@@ -179,6 +179,7 @@
        {       149,    "object size validation failed for kernel copyout" },
        {       150,    "error copying data out for kernel copyout" },
        {       151,    "version mismatch for kernel copyout" },
+       {       152,    "direction does not match the group rule" },
 /* -------------------------------------------------------------------------- */
        {       10001,  "could not find token for auth iterator" },
        {       10002,  "write permissions require to add/remove auth rule" },
diff -r a40be3b7967f -r e1965789f95b sys/external/bsd/ipf/netinet/fil.c
--- a/sys/external/bsd/ipf/netinet/fil.c        Wed Apr 01 23:31:37 2015 +0000
+++ b/sys/external/bsd/ipf/netinet/fil.c        Thu Apr 02 00:12:58 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.15 2014/06/16 12:38:32 christos Exp $        */
+/*     $NetBSD: fil.c,v 1.16 2015/04/02 00:12:58 khorben Exp $ */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -138,7 +138,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.15 2014/06/16 12:38:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.16 2015/04/02 00:12:58 khorben Exp $");
 #else
 static const char sccsid[] = "@(#)fil.c        1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 1.1.1.2 2012/07/22 13:45:07 darrenr Exp $";
@@ -4495,6 +4495,11 @@
                        if (addrem == 0) {
                                fg = ipf_group_add(softc, group, NULL,
                                                   fp->fr_flags, unit, set);
+                               if (fg == NULL) {
+                                       IPFERROR(152);
+                                       error = ESRCH;
+                                       goto donenolock;
+                               }
                                fp->fr_grp = fg;
                        } else {
                                fg = ipf_findgroup(softc, group, unit,



Home | Main Index | Thread Index | Old Index