[Bug 220237] sys/dev/mlx/mlx.c: A possible sleep-under-mutex bug in mlx_alloccmd

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


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

            Bug ID: 220237
           Summary: sys/dev/mlx/mlx.c: A possible sleep-under-mutex bug in
                    mlx_alloccmd
           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 function call path is:
mlx_attach [line 432: acquire the mutex]
  mlx_enquire
    mlx_alloccmd
      bus_dmamap_create(BUS_DMA_WAITOK) --> 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