HomeFreeBSD

mld6: Ensure that mld_domifattach() always succeeds

Description

mld6: Ensure that mld_domifattach() always succeeds

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. 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.

PR: 261457
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34943

Details

Provenance
markjAuthored on Apr 21 2022, 5:22 PM
Differential Revision
D34943: mld6: Ensure that mld_domifattach() always succeeds
Parents
rGefc64d02a62f: pf: counter argument to pfr_pool_get() may never be NULL
Branches
Unknown
Tags
Unknown