Module Name: src
Committed By: snj
Date: Mon Feb 26 00:33:08 UTC 2018
Modified Files:
src/sys/dist/pf/net [netbsd-8]: pf.c
Log Message:
Pull up following revision(s) (requested by alnsn in ticket #570):
sys/dist/pf/net/pf.c: 1.79-1.80
PR/53036: Alexander Nasonov: 'block user' in pf's ruleset panics 8.0_BETA
Check for NULL.
--
It is normal for socket credentials to be missing for incoming sockets,
so don't warn.
To generate a diff of this commit:
cvs rdiff -u -r1.76.6.1 -r1.76.6.2 src/sys/dist/pf/net/pf.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/dist/pf/net/pf.c
diff -u src/sys/dist/pf/net/pf.c:1.76.6.1 src/sys/dist/pf/net/pf.c:1.76.6.2
--- src/sys/dist/pf/net/pf.c:1.76.6.1 Sat Feb 10 04:12:17 2018
+++ src/sys/dist/pf/net/pf.c Mon Feb 26 00:33:08 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pf.c,v 1.76.6.1 2018/02/10 04:12:17 snj Exp $ */
+/* $NetBSD: pf.c,v 1.76.6.2 2018/02/26 00:33:08 snj 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.76.6.1 2018/02/10 04:12:17 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.76.6.2 2018/02/26 00:33:08 snj Exp $");
#include "pflog.h"
@@ -2847,6 +2847,8 @@ pf_socket_lookup(int direction, struct p
break;
#endif /* INET6 */
}
+ if (so == NULL || so->so_cred == NULL)
+ return -1;
pd->lookup.uid = kauth_cred_geteuid(so->so_cred);
pd->lookup.gid = kauth_cred_getegid(so->so_cred);
#else