Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jun 2017 08:09:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 220033] [if_ixgb] sys/dev/ixgb/if_ixgb.c: a sleep-under-mutex bug in ixge_get_buf
Message-ID:  <bug-220033-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D220033

            Bug ID: 220033
           Summary: [if_ixgb] sys/dev/ixgb/if_ixgb.c: a sleep-under-mutex
                    bug in ixge_get_buf
           Product: Base System
           Version: 11.0-RELEASE
          Hardware: i386
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: baijiaju1990@163.com

The ixgb driver may sleep under a mutex, and the function call path in file
"sys/dev/ixgb/if_ixgb.c" in FreeBSD 11.0 is:
ixgb_init [line 750: acquire the mutex]
  ixgb_init_locked [line 751]
    ixgb_setup_receive_structures [line 699]
      ixgb_allocate_receive_structures [line 1913]
        ixgb_get_buf [line 1885]
          bus_dmamap_load(BUS_DMA_WAITOK) [line 1812] --> may sleep

The possible fix of these bugs is to set the last parameter in bus_dmamap_l=
oad
to "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.

By the way, I am a freshman in developing FreeBSD drivers, and I am willing=
 to
submit a patch. But I do not know how to write and submit a patch, and wher=
e to
submit, so I am looking forward to useful advice :)

Jia-Ju Bai

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-220033-8>