HomeFreeBSD

truss: Make control message header parsing more robust

Description

truss: Make control message header parsing more robust

print_cmsg() was assuming that the control message chain is well-formed,
but that isn't necessarily the case for sendmsg(2). In particular, if
cmsg_len is zero, print_cmsg() will loop forever. Check for truncated
headers and try to recover if possible.

Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35476

Details

Provenance
markjAuthored on Jun 14 2022, 3:34 PM
Reviewer
tuexen
Differential Revision
D35476: truss: Make control message header parsing more robust
Parents
rGa14465e1b9a5: rip6: Fix a lock order reversal in rip6_bind()
Branches
Unknown
Tags
Unknown