Date: Wed, 14 Jun 2017 14:20:46 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 219986] [mly] sys/dev/mly/mly.c: a sleep-under-mutex bug in mly_user_command Message-ID: <bug-219986-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219986 Bug ID: 219986 Summary: [mly] sys/dev/mly/mly.c: a sleep-under-mutex bug in mly_user_command 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 mly driver may sleep under a mutex, and the function call path in file "sys/dev/mly/mly.c" in FreeBSD 11.0 is: mly_user_command [line 2925: acquire the mutex] mly_start [line 2926] mly_map_command [line 1489] bus_dmamap_load_ccb(BUS_DMA_WAITOK) [line 1880] --> may sleep bus_dmamap_load(BUS_DMA_WAITOK) [line 1883] --> may sleep The possible fix of this bug is to set last parameter in bus_dmamap_load_ccb and bus_dmamap_load 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 to fix this bug. But I do not know how to write and submit a patch, and where 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-219986-8>