HomeFreeBSD

libnv: Fix handling of nvlist_dump() and nvlist_send() for child nvlists

Description

libnv: Fix handling of nvlist_dump() and nvlist_send() for child nvlists

Suppose an nvlist nvl belongs to a parent nvlist or nvlist array. In
this case, nvl contains a pointer to its container. This trips up
nvlist_send(nvl) and nvlist_dump(nvl), which intuitively should only
operate on nvl and its nvpairs. In particular, both of these functions
will traverse to nvl's parent and start sending/dumping the parent's
nvpairs, which results in assertion failures or nonsensical output,
respectively.

Reviewed by: oshogbo
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D52360

Details

Provenance
markjAuthored on Sep 10 2025, 2:33 PM
Reviewer
oshogbo
Differential Revision
D52360: libnv: Fix handling of nvlist_dump() and nvlist_send() for child nvlists
Parents
rG187ee62c71f2: dhclient: improve UDP checksum handling
Branches
Unknown
Tags
Unknown