NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/38085: l_priority not protected against sloppy developers.



>Number:         38085
>Category:       kern
>Synopsis:       l_priority not protected against sloppy developers.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 22 21:00:00 +0000 2008
>Originator:     Herb Peyerl
>Release:        NetBSD-current
>Organization:
>Environment:
System: NetBSD andgasm.beer.org 3.1 NetBSD 3.1 (GENERIC.MP) #0: Tue Oct 31 
04:42:38 UTC 2006 
builds%b0.netbsd.org@localhost:/home/builds/ab/netbsd-3-1-RELEASE/i386/200610302053Z-obj/home/builds/ab/netbsd-3-1-RELEASE/src/sys/arch/i386/compile/GENERIC.MP
 i386
Architecture: i386
Machine: i386
>Description:

        A sloppy programmer (not me) who does:

    tsleep( arg, -1, "zzzzzz", 0 );

...can inadvertantly trash the runqueue/sleepq's causing someone (me) to spend
lots of quality time with ddb...

>How-To-Repeat:
>Fix:
        Something like this?

Index: kern_sleepq.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_sleepq.c,v
retrieving revision 1.21
diff -r1.21 kern_sleepq.c
456c456
<       l->l_priority = pri;
---
>       l->l_priority = (pri & MAXPRI);
472c472
<       l->l_inheritedprio = pri;
---
>       l->l_inheritedprio = (pri & MAXPRI);



Home | Main Index | Thread Index | Old Index