NetBSD-Bugs archive

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

kern/44370: lfs_markv may free kernel-lock too much



>Number:         44370
>Category:       kern
>Synopsis:       lfs_markv may free kernel-lock too much
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 11 11:40:00 +0000 2011
>Originator:     Dr. Wolfgang Stukenbrock
>Release:        NetBSD 5.1
>Organization:
Dr. Nagler & Company GmbH
>Environment:
        
        
System: NetBSD test-s0 4.0 NetBSD 4.0 (NSW-WS) #0: Tue Aug 17 17:28:09 CEST 
2010 wgstuken@test-s0:/usr/src/sys/arch/amd64/compile/NSW-WS amd64
Architecture: x86_64
Machine: amd64
>Description:
        lfs_markv() is called with kernel lock aquired and the caller releases 
the kernel lock
        in any case after return from lfs_markv().
        remark: I've found no call to this routine outside of 
/usr/src/sys/ufs/lfs/lfs_syscalls.c where
                this routine is located too.
        Accedently in one error case (label "err3:") lfs_markv() will free the 
kernel lock itself.
        In case of this error the kernel lock may be freed for a caller that 
has aquired the lock before,
        resulting in unsynchronized access to critical portions.
>How-To-Repeat:
        Found by a look into the source while searching for a deadlock that 
seems to be relatd
        to the kernel lock.
>Fix:
        not shure ...
        either remove the unlock at "err3:" label
        or all calls to lfs_markv() should evaluate a return value to determine 
that
        the kernel lock has already freed
        Perhaps someone else should have a look at this.

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index