ASoC: SOF: ipc4-control: Validate notification payload size#5804
Open
ujfalusi wants to merge 1 commit into
Open
ASoC: SOF: ipc4-control: Validate notification payload size#5804ujfalusi wants to merge 1 commit into
ujfalusi wants to merge 1 commit into
Conversation
Validate MODULE_NOTIFICATION payload length before reading bytes/channel data in control update handling. Fixes: 2a28b52 ("ASoC: SOF: ipc4-control: Add support for generic bytes control") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens SOF IPC4 kcontrol notification handling by validating MODULE_NOTIFICATION payload lengths before reading variable-sized bytes or channel/value data, preventing out-of-bounds reads when firmware sends malformed/truncated notifications.
Changes:
- Add payload length checks for bytes-control notifications (
msg_data->data). - Add payload length checks for channel/value notifications (
msg_data->chanv[]). - Ensure invalid notifications mark the cached control data as dirty and still trigger a user-space control notification.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lgirdwood
approved these changes
Jun 8, 2026
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.
Validate MODULE_NOTIFICATION payload length before reading bytes/channel data in control update handling.
Fixes: 2a28b52 ("ASoC: SOF: ipc4-control: Add support for generic bytes control")