Page MenuHomeFreeBSD

initialize the STATE_LOCK in iflib_register
ClosedPublic

Authored by jacob.e.keller_intel.com on Sep 5 2019, 10:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 17 2024, 9:04 AM
Unknown Object (File)
Dec 23 2023, 12:35 PM
Unknown Object (File)
Dec 19 2023, 1:35 PM
Unknown Object (File)
Dec 10 2023, 8:27 PM
Unknown Object (File)
Nov 15 2023, 1:32 PM
Unknown Object (File)
Sep 12 2023, 11:10 PM
Unknown Object (File)
Sep 6 2023, 2:55 AM
Unknown Object (File)
Aug 14 2023, 8:50 PM
Subscribers

Details

Summary

r347197 contained an MFC for r332389, adding the STATE_LOCK to the iflib
core driver. Unfortunately, the commit accidentally missed adding the
STATE_LOCK_INIT.

Without this, if you build a STABLE-11 kernel with INVARIANTS enabled,
any mtx_lock of the state lock will result in a panic:

panic: mtx_lock() of spin mutex (null) @ /usr/src/sys/net/iflib.c:5522

It actually ends up looking like a panic due to taking a spin mutex when
we could be interrupted. However, the real cause is because the lock
class was never initialized.

Initialize the STATE_LOCK properly during iflib_register to fix this.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26296
Build 24775: arc lint + arc unit

Event Timeline

This is specifically a fix for 11-STABLE. It's already fixed in CURRENT and STABLE-12. It looks like it was an accidental miss in MFC for STABLE-11 a few months ago.

This revision is now accepted and ready to land.Sep 9 2019, 6:03 PM
This revision was automatically updated to reflect the committed changes.