-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: comp_dev: initialize buffer lists to prevent NULL dereference #9689
fix: comp_dev: initialize buffer lists to prevent NULL dereference #9689
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thanks for submitting fix @tmleman !
One request to the commit message: The commit description leaves a bit open in which case this is triggered. I think it would help to mention the list_init is called in comp_new() (for both IPC3 and IPC4), but NULL dereference can happen in the component ops->create() which is called before list is initialized. One affected component is IPC4 copier_ipcgtw (you can add a "Link: #9687"
955d7ee
to
5f5588c
Compare
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thanks for the quick update!
This patch addresses a NULL dereference issue in the SOF firmware that was exposed by a recent change in Zephyr's MMU mapping for Intel ADSP ACE30. The change prevents mapping of the 0x0 address, which helps catch NULL pointer accesses. The issue was identified during testing, where an exception occurred due to uninitialized buffer lists in the `comp_dev` structure. The `list_init` function is called in `comp_new()` (for both IPC3 and IPC4), but a NULL dereference can happen in the component `ops->create()` function, which is called before the list is initialized. One affected component is IPC4 `copier_ipcgtw`. To fix this, the `bsink_list` and `bsource_list` are now initialized in the `comp_alloc` function. This ensures that the lists point to themselves before any use, preventing NULL dereference and subsequent exceptions. Link: thesofproject#9687 Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
SOFCI TEST |
sof-docs fail and Intel LNL fails all known and tracked in https://github.com/thesofproject/sof/issues?q=is%3Aissue+is%3Aopen+label%3A%22Known+PR+Failures%22+ |
This patch addresses a NULL dereference issue in the SOF firmware that was exposed by a recent change in Zephyr's MMU mapping for Intel ADSP ACE30. The change prevents mapping of the 0x0 address, which helps catch NULL pointer accesses.
The issue was identified during testing, where an exception occurred due to uninitialized buffer lists in the
comp_dev
structure. To fix this, thebsink_list
andbsource_list
are now initialized in thecomp_alloc
function.This ensures that the lists point to themselves before any use, preventing NULL dereference and subsequent exceptions.