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
Unknown Object (File)
Fri, Jun 12, 3:15 AM
Unknown Object (File)
Thu, Jun 11, 7:31 PM
Unknown Object (File)
May 13 2026, 4:53 PM
Unknown Object (File)
May 13 2026, 4:53 PM
Unknown Object (File)
May 13 2026, 4:42 PM
Unknown Object (File)
May 7 2026, 2:00 AM
Unknown Object (File)
May 6 2026, 8:55 AM
Unknown Object (File)
May 6 2026, 6:53 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