Page MenuHomeFreeBSD

freebsd32_sendmsg: fix control message ABI
ClosedPublic

Authored by brooks on Aug 23 2022, 9:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 12, 7:04 AM
Unknown Object (File)
Sat, Jan 10, 4:02 PM
Unknown Object (File)
Wed, Jan 7, 9:38 AM
Unknown Object (File)
Wed, Jan 7, 9:38 AM
Unknown Object (File)
Sun, Jan 4, 8:24 AM
Unknown Object (File)
Mon, Dec 22, 3:05 AM
Unknown Object (File)
Dec 9 2025, 8:45 AM
Unknown Object (File)
Dec 2 2025, 8:37 PM
Subscribers

Details

Summary

When a freebsd32 caller uses all or most allowed space for control
messages (MCLBYTES == 2K) then the message may no longer fit when
the messages are padded for 64-bit alignment. Historically we've just
shrugged and said there is no ABI guarantee. We ran into this on
CheriBSD where a capsicumized 64-bit nm would fail when called with more
than 64 files.

Fix this by not gratutiously capping size of mbuf data we'll allocate
to MCLBYTES and let m_get2 allocate up to MJUMPAGESIZE (4K or larger).
Instead of hard-coding a length check, let m_get2 do it and check for a
NULL return.

Sponsored by: DARPA, AFRL

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable