Page MenuHomeFreeBSD

freebsd32_sendmsg: fix control message ABI
ClosedPublic

Authored by brooks on Aug 23 2022, 9:16 PM.
Tags
None
Referenced Files
F150633336: D36322.id109774.diff
Thu, Apr 2, 11:31 PM
Unknown Object (File)
Sat, Mar 14, 8:45 PM
Unknown Object (File)
Mon, Mar 9, 7:29 AM
Unknown Object (File)
Mon, Mar 9, 6:25 AM
Unknown Object (File)
Feb 26 2026, 9:05 AM
Unknown Object (File)
Feb 20 2026, 3:35 AM
Unknown Object (File)
Feb 9 2026, 12:04 AM
Unknown Object (File)
Jan 29 2026, 12:05 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 Passed
Unit
No Test Coverage
Build Status
Buildable 47092
Build 43979: arc lint + arc unit