Page MenuHomeFreeBSD

mld6: Ensure that mld_domifattach() always succeeds
ClosedPublic

Authored by markj on Apr 18 2022, 4:17 PM.
Tags
None
Referenced Files
F168276832: D34943.id105271.diff
Thu, Aug 27, 8:35 AM
Unknown Object (File)
Wed, Aug 26, 4:44 AM
Unknown Object (File)
Fri, Aug 21, 2:42 PM
Unknown Object (File)
Thu, Aug 20, 1:30 AM
Unknown Object (File)
Wed, Aug 12, 1:30 PM
Unknown Object (File)
Wed, Aug 12, 1:21 PM
Unknown Object (File)
May 13 2026, 6:01 PM
Unknown Object (File)
May 13 2026, 5:43 PM

Details

Summary

mld_domifattach() does a memory allocation under the global MLD mutex,
and so can fail (but no error handling prevents a null pointer
dereference in this case). However, the mutex is only needed when
updating the global softc list; the allocation and static initialization
of the softc does not require this mutex. So, reduce the scope of the
mutex and use M_WAITOK for the allocation.

No functional change intended.

PR: 261457

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45204
Build 42092: arc lint + arc unit

Event Timeline

markj requested review of this revision.Apr 18 2022, 4:17 PM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 21 2022, 5:27 PM
This revision was automatically updated to reflect the committed changes.