Module Name:    src
Committed By:   christos
Date:           Sat Nov  2 20:09:33 UTC 2013

Modified Files:
        src/sys/kern: uipc_socket.c

Log Message:
PR/48098: Brian Marcotte: panic: kernel diagnostic assertion "cred != NULL":
Fix from Michael van Elst, tcpdrop crashes kernel on ebryonic connections.


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/kern/uipc_socket.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/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.219 src/sys/kern/uipc_socket.c:1.220
--- src/sys/kern/uipc_socket.c:1.219	Thu Oct 17 16:57:06 2013
+++ src/sys/kern/uipc_socket.c	Sat Nov  2 16:09:33 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.219 2013/10/17 20:57:06 christos Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.220 2013/11/02 20:09:33 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.219 2013/10/17 20:57:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.220 2013/11/02 20:09:33 christos Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_sock_counters.h"
@@ -416,7 +416,7 @@ socket_listener_cb(kauth_cred_t cred, ka
 		/* Normal users can only drop their own connections. */
 		struct socket *so = (struct socket *)arg1;
 
-		if (proc_uidmatch(cred, so->so_cred) == 0)
+		if (so->so_cred && proc_uidmatch(cred, so->so_cred) == 0)
 			result = KAUTH_RESULT_ALLOW;
 
 		break;

Reply via email to