PERFORCE change 104436 for review
Chris Jones
cdjones at FreeBSD.org
Thu Aug 17 20:55:40 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=104436
Change 104436 by cdjones at 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 +
More information about the p4-projects
mailing list