Conversation
tmleman
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1,
pblaszko and
plbossart
as code owners
October 2, 2026 12:28
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The alignment changes match IPC4 guarantees while preserving structure sizes and member offsets.
Review effort: Balanced
Findings: None
What changed in this PR
Aligns IPC4 volume and probe initialization payload declarations with the protocol’s 4-byte alignment guarantee, preventing misaligned accesses without changing wire layouts.
Changes:
- Changes peak-volume configuration alignment from 8 to 4 bytes.
- Changes probe module configuration alignment from 8 to 4 bytes.
| File | Description |
|---|---|
src/include/ipc4/probe.h |
Corrects probe initialization payload alignment. |
src/audio/volume/peak_volume.h |
Corrects peak-volume payload alignment. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
struct ipc4_peak_volume_config, struct ipc4_peak_volume_module_cfg and struct ipc4_probe_module_cfg are declared __packed __aligned(8) and are dereferenced in place in the hostbox via mod->priv.cfg.init_data. The IPC4 INIT_MODULE_INSTANCE payload only guarantees 4-byte alignment: when the extension has extended_init set, the module config follows the 12-byte struct ipc4_module_init_ext_init (plus optional 4-byte-granular ext init objects), so it lands at a 4-byte aligned offset. The Linux driver uses extended init for DP modules, so this happens on real hardware, not only under native_sim. UBSan reports "member access within misaligned address ... which requires 8 byte alignment" in volume_init() and probe_mod_init(). Relax the declared alignment to 4 bytes, matching every other IPC4 payload struct. sizeof() and all member offsets are unchanged (24/40 and 48 bytes respectively), so the wire layout is untouched. Found by the IPC4 libFuzzer campaign with -fsanitize=undefined. 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.
struct ipc4_peak_volume_config, struct ipc4_peak_volume_module_cfg and struct ipc4_probe_module_cfg are declared __packed __aligned(8) and are dereferenced in place in the hostbox via mod->priv.cfg.init_data.
The IPC4 INIT_MODULE_INSTANCE payload only guarantees 4-byte alignment: when the extension has extended_init set, the module config follows the 12-byte struct ipc4_module_init_ext_init (plus optional 4-byte-granular ext init objects), so it lands at a 4-byte aligned offset. The Linux driver uses extended init for DP modules, so this happens on real hardware, not only under native_sim. UBSan reports "member access within misaligned address ... which requires 8 byte alignment" in volume_init() and probe_mod_init().
Relax the declared alignment to 4 bytes, matching every other IPC4 payload struct. sizeof() and all member offsets are unchanged (24/40 and 48 bytes respectively), so the wire layout is untouched.
Found by the IPC4 libFuzzer campaign with -fsanitize=undefined.