Subject: kern/25595: pagefault fails to release kernel_lock when going to block
To: None <gnats-bugs@gnats.netbsd.org>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 05/16/2004 21:51:06
>Number: 25595
>Category: kern
>Synopsis: pagefault fails to release kernel_lock when going to block
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun May 16 12:52:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release: NetBSD 2.0E
>Organization:
>Environment:
System: NetBSD kaeru 2.0E NetBSD 2.0E (build.kaeru) #1299: Sun May 16 19:28:27 JST 2004 takashi@kaeru:/home/takashi/work/kernel/build.kaeru i386
Architecture: i386
Machine: i386
>Description:
(the following example assumes i386.
but i don't think that other ports are very different.)
1. syscall() uses copyin() for syscall args without
holding kernel_lock.
2. trap() uses KERNEL_LOCK to grab kernel_lock.
3. uvm_fault blocks.
4. as L_BIGLOCK isn't set, kernel_lock won't be released in mi_switch.
>How-To-Repeat:
>Fix:
change KERNEL_PROC_LOCK to use LK_CANRECURSE and use it for traps?
probably it's better to unify KERNEL_LOCK and KERNEL_PROC_LOCK.
>Release-Note:
>Audit-Trail:
>Unformatted: