Page MenuHomeFreeBSD

Don't read if_counters with if_addr_lock held
ClosedPublic

Authored by rstone on Nov 11 2016, 5:41 PM.
Tags
None
Referenced Files
F131934912: D8498.id.diff
Sun, Oct 12, 8:07 AM
Unknown Object (File)
Fri, Oct 10, 2:51 PM
Unknown Object (File)
Sat, Sep 13, 10:51 PM
Unknown Object (File)
Sat, Sep 13, 11:28 AM
Unknown Object (File)
Aug 17 2025, 12:59 AM
Unknown Object (File)
Aug 11 2025, 6:50 AM
Unknown Object (File)
Aug 2 2025, 3:33 AM
Unknown Object (File)
Jul 6 2025, 11:48 PM
Subscribers
None

Details

Summary

Calling into an ifnet implementation with the if_addr_lock already
held can cause a LOR and potentially a deadlock, as ifnet
implementations typically can take the if_addr_lock after their
own locks during configuration. Refactor a sysctl handler that
was violating this to read if_counter data in a temporary buffer
before the if_addr_lock is taken, and then copying the data
in its final location later, when the if_addr_lock is held.

PR: 194109
Reported by: Jean-Sebastien Pedron
MFC after: 2 weeks

Diff Detail

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

Event Timeline

rstone retitled this revision from to Don't read if_counters with if_addr_lock held.
rstone updated this object.
rstone edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Nov 12 2016, 5:38 PM
This revision was automatically updated to reflect the committed changes.