audio: copier: avoid serializing uninitialized stream position to host#10859
Open
abonislawski wants to merge 1 commit into
Open
audio: copier: avoid serializing uninitialized stream position to host#10859abonislawski wants to merge 1 commit into
abonislawski wants to merge 1 commit into
Conversation
copier_get_configuration() returns LLP/position data to the host over IPC4 for IPC4_COPIER_MODULE_CFG_PARAM_LLP_READING and _EXTENDED. It declared the source 'posn' on the stack without initialization and called comp_position() ignoring its return value. On Zephyr-native DAI builds dai_common_position() writes posn.comp_posn only after a successful dma_get_status(); on a DMA-status error it returns early, leaving comp_posn uninitialized. The unchecked return then let convert_u64_to_u32s() serialize uninitialized stack bytes into the host reply (information disclosure) and report a fabricated stream position. Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes IPC4 copier LLP/position reporting to avoid returning fabricated stream position data to the host when the DAI position query fails.
Changes:
- Zero-initializes the
sof_ipc_stream_posnstack struct before use. - Checks and propagates
comp_position()errors instead of ignoring the return value for LLP reading (standard and extended) replies.
Member
Author
|
Copilot's comments are wrong and don't follow the SOF error convention for get_large_config. |
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.
copier_get_configuration() returns LLP/position data to the host over IPC4 for IPC4_COPIER_MODULE_CFG_PARAM_LLP_READING and _EXTENDED. It declared the source 'posn' on the stack without initialization and called comp_position() ignoring its return value. On Zephyr-native DAI builds dai_common_position() writes posn.comp_posn only after a successful dma_get_status(); on a DMA-status error it returns early, leaving comp_posn uninitialized. The unchecked return then let convert_u64_to_u32s() serialize uninitialized stack bytes into the host reply and report a fabricated stream position.