fix: comp_dev: initialize buffer lists to prevent NULL dereference#9689
Conversation
kv2019i
left a comment
There was a problem hiding this comment.
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. |
kv2019i
left a comment
There was a problem hiding this comment.
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_devstructure. To fix this, thebsink_listandbsource_listare now initialized in thecomp_allocfunction.This ensures that the lists point to themselves before any use, preventing NULL dereference and subsequent exceptions.