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)
Thu, Oct 16, 7:02 AM
Unknown Object (File)
Wed, Oct 15, 10:43 AM
Unknown Object (File)
Wed, Oct 15, 10:43 AM
Unknown Object (File)
Wed, Oct 15, 10:43 AM
Unknown Object (File)
Tue, Oct 14, 11:51 PM
Unknown Object (File)
Thu, Sep 18, 9:32 PM
Unknown Object (File)
Sep 2 2025, 8:39 PM
Unknown Object (File)
Sep 2 2025, 4:02 PM
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