[Bug 220235] sys/dev/aacraid/aacraid.c: A sleep-under-mutex bug in aac_alloc_commands

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Jun 24 03:06:03 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220235

            Bug ID: 220235
           Summary: sys/dev/aacraid/aacraid.c: A sleep-under-mutex bug in
                    aac_alloc_commands
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: baijiaju1990 at 163.com

The driver may sleep under a mutex, and the code path is:
aac_alloc_commands [line 1223: acquire the mutex]
aac_alloc_commands [line 1227]
  bus_dmamap_create(BUS_DMA_WAITOK) [line 1250] --> may sleep

The possible fix of this bug is to replace the "BUS_DMA_WAITOK" in
bus_dmamap_create with "BUS_DMA_NOWAIT".

This bug is found by a static analysis tool written by myself, and it is
checked by my review of the FreeBSD code.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list