fuzz: posix: widen fuzz framing length to 2 bytes#10956
Open
tmleman wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the POSIX IPC fuzzing harness framing to use a 2-byte little-endian length prefix so libFuzzer can generate IPC messages large enough to exercise IPC4’s larger message envelope and improve coverage of large-config/vendor-config related paths.
Changes:
- Switch fuzz input framing from a 1-byte (×2) length prefix to a 2-byte little-endian byte-count prefix.
- Introduce
POSIX_FUZZ_HDR_LENand update header arithmetic (copy/memmove) accordingly. - Update the in-file protocol documentation to reflect the new framing and rationale.
kv2019i
approved these changes
Jun 25, 2026
513d42e to
b5a3c6f
Compare
Contributor
Author
Fixed |
The fuzz harness in posix/ipc.c frames each IPC message using a length prefix at the start of the libFuzzer input buffer. Until now this prefix was a single byte multiplied by 2, encoding a maximum per-message payload of 510 bytes. That fits IPC3 (SOF_IPC_MSG_MAX_SIZE = 384) but caps IPC4 at ~12% of its 4096-byte envelope, hiding the entire large_config / vendor_config / pipeline-state-data path family from coverage feedback. Replace the prefix with two little-endian bytes, encoding lengths up to 65535 (still clamped to SOF_IPC_MSG_MAX_SIZE - 4 in code). The remainder of the framing logic is mechanically updated to consume two header bytes per message. Introduce POSIX_FUZZ_HDR_LEN to keep header arithmetic self-documenting. Existing IPC3 and IPC4 corpora are reinterpreted under the new header: what was previously a length byte becomes the low byte of a 16-bit length, with the next byte becoming the high byte. libFuzzer's mutation engine re-discovers productive frame shapes within minutes of running, so the corpora are kept rather than regenerated. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fuzz harness in posix/ipc.c frames each IPC message using a length prefix at the start of the libFuzzer input buffer. Until now this prefix was a single byte multiplied by 2, encoding a maximum per-message payload of 510 bytes. That fits IPC3 (SOF_IPC_MSG_MAX_SIZE = 384) but caps IPC4 at ~12% of its 4096-byte envelope, hiding the entire large_config / vendor_config / pipeline-state-data path family from coverage feedback.
Replace the prefix with two little-endian bytes, encoding lengths up to 65535 (still clamped to SOF_IPC_MSG_MAX_SIZE - 4 in code). The remainder of the framing logic is mechanically updated to consume two header bytes per message. Introduce POSIX_FUZZ_HDR_LEN to keep header arithmetic self-documenting.
Existing IPC3 and IPC4 corpora are reinterpreted under the new header: what was previously a length byte becomes the low byte of a 16-bit length, with the next byte becoming the high byte. libFuzzer's mutation engine re-discovers productive frame shapes within minutes of running, so the corpora are kept rather than regenerated.