Source-Changes-HG archive

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

[src/trunk]: src/sys/dist/pf/net PR/53036: Alexander Nasonov: 'block user' in...



details:   https://anonhg.NetBSD.org/src/rev/ee3b208e898b
branches:  trunk
changeset: 829943:ee3b208e898b
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Feb 18 21:51:28 2018 +0000

description:
PR/53036: Alexander Nasonov: 'block user' in pf's ruleset panics 8.0_BETA
Check for NULL.

diffstat:

 sys/dist/pf/net/pf.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r a12717c3a19d -r ee3b208e898b sys/dist/pf/net/pf.c
--- a/sys/dist/pf/net/pf.c      Sun Feb 18 21:31:32 2018 +0000
+++ b/sys/dist/pf/net/pf.c      Sun Feb 18 21:51:28 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pf.c,v 1.78 2018/02/09 21:25:04 maxv Exp $     */
+/*     $NetBSD: pf.c,v 1.79 2018/02/18 21:51:28 christos Exp $ */
 /*     $OpenBSD: pf.c,v 1.552.2.1 2007/11/27 16:37:57 henning Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.78 2018/02/09 21:25:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.79 2018/02/18 21:51:28 christos Exp $");
 
 #include "pflog.h"
 
@@ -2847,6 +2847,13 @@
                break;
 #endif /* INET6 */
        }
+       if (so == NULL)
+               return -1;
+       if (so->so_cred == NULL) {
+               DPFPRINTF(PF_DEBUG_URGENT,
+                   ("%s: so->so_cred == NULL so=%p\n", __func__, so));
+               return -1;
+       }
        pd->lookup.uid = kauth_cred_geteuid(so->so_cred);
        pd->lookup.gid = kauth_cred_getegid(so->so_cred);
 #else



Home | Main Index | Thread Index | Old Index