From owner-p4-projects@FreeBSD.ORG Thu Aug 17 20:55:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A94A516A4E5; Thu, 17 Aug 2006 20:55:39 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8219316A4E0 for ; Thu, 17 Aug 2006 20:55:39 +0000 (UTC) (envelope-from cdjones@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F61443D46 for ; Thu, 17 Aug 2006 20:55:39 +0000 (GMT) (envelope-from cdjones@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7HKtdPH092159 for ; Thu, 17 Aug 2006 20:55:39 GMT (envelope-from cdjones@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7HKtdCq092156 for perforce@freebsd.org; Thu, 17 Aug 2006 20:55:39 GMT (envelope-from cdjones@FreeBSD.org) Date: Thu, 17 Aug 2006 20:55:39 GMT Message-Id: <200608172055.k7HKtdCq092156@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cdjones@FreeBSD.org using -f From: Chris Jones To: Perforce Change Reviews Cc: Subject: PERFORCE change 104436 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 20:55:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=104436 Change 104436 by cdjones@cdjones_meanook on 2006/08/17 20:55:33 Fix kernel panics by being more paranoid about KSEs having credentials. Affected files ... .. //depot/projects/soc2006/cdjones_jail/src/sys/kern/sched_hier.c#16 edit Differences ... ==== //depot/projects/soc2006/cdjones_jail/src/sys/kern/sched_hier.c#16 (text+ko) ==== @@ -550,7 +550,8 @@ continue; kg->kg_estcpu = decay_cpu(loadfac, kg->kg_estcpu); total_est_cpu += kg->kg_estcpu; - if (kg->kg_proc->p_ucred->cr_prison) + if (NULL != kg->kg_proc->p_ucred && + NULL != kg->kg_proc->p_ucred->cr_prison) kg->kg_proc->p_ucred->cr_prison->pr_estcpu += kg->kg_estcpu; resetpriority(kg); @@ -641,7 +642,9 @@ resetpriority(struct ksegrp *kg) { register unsigned int newpriority; - struct prison *pr = kg->kg_proc->p_ucred->cr_prison; + struct prison *pr = NULL; + if (NULL != kg->kg_proc->p_ucred) + pr = kg->kg_proc->p_ucred->cr_prison; if (kg->kg_pri_class == PRI_TIMESHARE) { newpriority = PUSER + kg->kg_estcpu / INVERSE_ESTCPU_WEIGHT +