kern/80980: problem in "sys/i386/include/bus.h" cause random freezes

Hans Petter Selasky hselasky at
Fri May 13 13:30:02 GMT 2005

>Number:         80980
>Category:       kern
>Synopsis:       problem in "sys/i386/include/bus.h" cause random freezes
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 13 13:30:01 GMT 2005
>Originator:     HPS
>Release:        FreeBSD 6.0-CURRENT i386
System: FreeBSD 6.0-CURRENT FreeBSD 6.0-CURRENT #45: Mon Mar 21 15:40:17 CET 
2005 root@:/usr/obj/usr/src/sys/custom i386


When using I386_BUS_SPACE_MEM, neither "bus_space_read_XXX" nor 
"bus_space_write_XXX" checks for length/count equal to zero. This can cause 
random freezes with some drivers.

Actually the code is like this, just in assembly:


which is not correct. This happens several places in "sys/i386/include/bus.h".


bus_space_read_multi_2(t,h,0,&buf[0],0); will freeze the system !

"t","h", and "buf" must be valid though, and "t" must equal 


Wrap all "__asm __volatile" statements inside:

if(count != 0)


More information about the freebsd-bugs mailing list