Page MenuHomeFreeBSD

socket_msg_trunc: allocate a large enough buffer
ClosedPublic

Authored by brooks on Jan 6 2024, 12:41 AM.
Tags
None
Referenced Files
F139987585: D43340.id132359.diff
Thu, Dec 18, 5:06 PM
Unknown Object (File)
Sat, Dec 13, 8:13 PM
Unknown Object (File)
Sat, Nov 22, 3:06 PM
Unknown Object (File)
Sat, Nov 22, 2:31 PM
Unknown Object (File)
Nov 13 2025, 12:35 AM
Unknown Object (File)
Nov 12 2025, 6:46 PM
Unknown Object (File)
Nov 10 2025, 5:20 AM
Unknown Object (File)
Oct 22 2025, 2:09 AM
Subscribers

Details

Summary

Allocate 9000 bytes to match the largest requsted size. Add a check to
prevent the list of sizes and buffer size from getting out of sync
again.

Found with: CheriBSD

Diff Detail

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

Event Timeline

It'd be a bit cleaner to allocate the buffer with malloc(), but this works.

tests/sys/kern/socket_msg_trunc.c
55
This revision is now accepted and ready to land.Jan 6 2024, 3:34 PM