HomeFreeBSD

Prevent detaching driver if the attach is not finished

Description

Prevent detaching driver if the attach is not finished

When the device is in attaching state, detach should return
EBUSY instead of success. In other case, there could be race
between attach and detach during the driver unloading.

If driver goes sleep and releases GIANT lock during attaching,
unloading module could start. In such case when attach continues
after module unload, page fault "supervisor read instruction,
page not present" occurred.

This patch works around the real issue, which is a locking
deficiency of the busses.

Submitted by: Rafal Kozik <rk@semihalf.com>
Reviewed by: imp
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D19375

Details

Committed
mwMar 1 2019, 1:18 AM
Reviewer
imp
Differential Revision
D19375: Prevent detaching driver if the attach is not finished
Parents
rS344675: GEOM: Add fdt_slicer to the GEOM flashmap module for fdt-based platforms
Branches
Unknown
Tags
Unknown