kern/145434: Kernel messages about processes don't include Jail Identifier

David E. Cross dcross at okcupid.com
Tue Apr 6 14:50:05 UTC 2010


>Number:         145434
>Category:       kern
>Synopsis:       Kernel messages about processes don't include Jail Identifier
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 06 14:50:04 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     David E. Cross
>Release:        8.0-RELEASE-amd64
>Organization:
Humor Rainbow Inc.
>Environment:
FreeBSD foo.bar.baz 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Mon Apr  5 14:42:00 EDT 2010     root at foo.bar.baz:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Processes which exit abnormally display a kernel message to this effect that includes some basic information about the process.  Its PID, its UID, its name.

On a machine with a lot of jails, this information can be essentially useless.

Consider a webhost with 50 jails serving PHP via fastcgi and one is crashing, its near impossible to track it down with just the information as currently provided.

>How-To-Repeat:
Try to trace down a coredump on a machine with lots of jails
>Fix:
Apply the included patch.

Patch attached with submission follows:

--- sys/kern/kern_sig.c.orig	2009-10-24 21:10:29.000000000 -0400
+++ sys/kern/kern_sig.c	2010-04-06 10:44:42.000000000 -0400
@@ -57,6 +57,8 @@
 #include <sys/mutex.h>
 #include <sys/namei.h>
 #include <sys/proc.h>
+#include <sys/ucred.h>
+#include <sys/jail.h>
 #include <sys/posix4.h>
 #include <sys/pioctl.h>
 #include <sys/resourcevar.h>
@@ -2733,8 +2735,9 @@
 			sig |= WCOREFLAG;
 		if (kern_logsigexit)
 			log(LOG_INFO,
-			    "pid %d (%s), uid %d: exited on signal %d%s\n",
+			    "pid %d (%s), jid %d, uid %d: exited on signal %d%s\n",
 			    p->p_pid, p->p_comm,
+			    (td->td_ucred && td->td_ucred->cr_prison) ? td->td_ucred->cr_prison->pr_id : 0, 
 			    td->td_ucred ? td->td_ucred->cr_uid : -1,
 			    sig &~ WCOREFLAG,
 			    sig & WCOREFLAG ? " (core dumped)" : "");


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list