Page MenuHomeFreeBSD

mld6: Ensure that mld_domifattach() always succeeds
ClosedPublic

Authored by markj on Apr 18 2022, 4:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 14 2024, 8:17 AM
Unknown Object (File)
Dec 20 2023, 6:27 AM
Unknown Object (File)
Nov 30 2023, 4:40 AM
Unknown Object (File)
Nov 6 2023, 11:17 PM
Unknown Object (File)
Oct 29 2023, 7:03 PM
Unknown Object (File)
Oct 26 2023, 11:43 AM
Unknown Object (File)
Sep 30 2023, 7:13 PM
Unknown Object (File)
Sep 21 2023, 10:17 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.