Page MenuHomeFreeBSD

iflib: hold the CTX lock in iflib_pseudo_register

Authored by on Mar 15 2019, 11:53 PM.
Referenced Files
Unknown Object (File)
Apr 25 2023, 5:46 PM
Unknown Object (File)
Apr 10 2023, 1:21 AM
Unknown Object (File)
Feb 4 2023, 8:14 PM
Unknown Object (File)
Jan 9 2023, 7:18 PM
Unknown Object (File)
Jan 9 2023, 9:28 AM
Unknown Object (File)
Dec 31 2022, 11:58 PM
Unknown Object (File)
Dec 24 2022, 7:24 PM
Unknown Object (File)
Dec 15 2022, 2:53 AM



The iflib_device_register function takes the CTX lock before calling
IFDI_ATTACH_PRE, and releases it upon finishing the registration.

Mirror this process in iflib_pseudo_register, so that we always hold the
CTX lock during the attach process when registering a pseudo interface
or a regular interface.

This was caught by code inspection while attempting to analyze where the
CTX lock was held.

Signed-off-by: Jacob Keller <>

Diff Detail

rS FreeBSD src repository - subversion
Lint Not Applicable
Tests Not Applicable

Event Timeline

erj added a subscriber: erj.

Anyone else have any feedback? It makes sense to me that the attach process for pseudo devices should use the context lock like the attach process for regular devices.

This revision is now accepted and ready to land.Mar 27 2019, 5:31 PM
This revision was automatically updated to reflect the committed changes.