Subject: kern/30233: raidstrategy() isn't interrupt-safe
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-bugs
Date: 05/14/2005 22:03:00
>Number:         30233
>Category:       kern
>Synopsis:       raidstrategy() isn't interrupt-safe
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 14 22:03:00 +0000 2005
>Originator:     Manuel Bouyer
>Release:        NetBSD 3.99.3
>Organization:
>Environment:
System: NetBSD rochebonne.antioche.eu.org 3.99.3 NetBSD 3.99.3 (ROCHEBONNE) #0: Sat May 14 15:33:21 CEST 2005 bouyer@pop.lip6.fr:/local/pop1/bouyer/tmp/i386/obj/local/pop1/bouyer/current/src/sys/arch/i386/compile/ROCHEBONNE i386
Architecture: i386
Machine: i386
>Description:
	Quoting a post from Jason Thorpe on tech-kern:
	> There are lots of other things that might cause a disk's strategy
	> routine to be called from interrupt context (ccd / raidframe are good
	> examples).  Really, we need to audit ALL of the disk strategy
	> routines and ensure that they are IPL_BIO interrupt-context safe.

	raidstrategy() isn't safe to call from interrupt context: it ends up
	calling pool_get(PR_WAITOK):
	raidstrategy()
	raidstart()
	rf_DoAccess()
	rf_AllocRaidAccDesc()
	pool_get()

	There may be other problems too other problems when called from
	interrupt context too (are the locks interrupt-safe ?).

>How-To-Repeat:
	An easy way to trigger a pool_get() panic is to export a partition
	from a raidframe device to a guest Xen domain, as reported by
	Yoshito Komatsu on port-xen.
>Fix:
	None provided.