Page MenuHomeFreeBSD

iflib: Prevent kernel panic caused by loading driver with a specific interrupt configuration
AbandonedPublic

Authored by erj on Jun 24 2019, 11:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 3:01 AM
Unknown Object (File)
Nov 12 2023, 10:34 AM
Unknown Object (File)
Nov 7 2023, 2:53 PM
Unknown Object (File)
Oct 9 2023, 9:28 AM
Unknown Object (File)
Oct 6 2023, 1:31 PM
Unknown Object (File)
Sep 17 2023, 6:38 AM
Unknown Object (File)
Sep 13 2023, 1:22 AM
Unknown Object (File)
Jun 3 2023, 7:59 AM
Subscribers

Details

Reviewers
shurd
Group Reviewers
iflib
Summary

If a device has only 1 MSI-X interrupt available and does not support either MSI or legacy
interrupts, iflib_device_register() will fail, leak memory and MSI resources, and the driver
will not load. Worse, if another iflib-using driver tries to unload afterwards, a kernel panic will occur
because the previous failed iflib driver loead did not properly call "taskqgroup_detach()" during it's
cleanup.

This patch is band-aid for this situation -- don't try allocating MSI or legacy interrupts if
a single MSI-X interrupt was allocated, but fail to load instead. As well, during the cleanup,
properly call taskqgroup_detach() on the admin task to prevent panics when other iflib
drivers unload.

This whole interrupt allocation process probably needs re-doing to properly support a single
MSI-X interrupt as well as supporting devices that only support MSI-X.

Signed-off-by: Eric Joyner <erj@freebsd.org>

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25017
Build 23731: arc lint + arc unit