Skip to content

audio: kpb: fix potential NULL pointer dereference in device list reset - #9691

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
tmleman:topic/upstream/pr/kpb/fix/null_dereference
Dec 3, 2024
Merged

lgirdwood merged 1 commit into
thesofproject:mainfrom
tmleman:topic/upstream/pr/kpb/fix/null_dereference

Conversation

@tmleman

@tmleman tmleman commented Nov 28, 2024

Copy link
Copy Markdown
Contributor

This patch addresses a potential NULL pointer dereference issue in the devicelist_reset function within the Key Phrase Buffer (KPB) component. The issue was exposed by a recent change in Zephyr's MMU mapping for Intel ADSP ACE30, which now catches NULL pointer accesses.

The devicelist_reset function previously iterated over the entire DEVICE_LIST_SIZE when clearing items and zeroing pointers, which could lead to dereferencing NULL pointers. The fix involves iterating only up to devlist->count to ensure that only valid pointers are accessed.

This change prevents potential NULL pointer dereference and ensures the stability of the KPB component.

This patch addresses a potential NULL pointer dereference issue in the
`devicelist_reset` function within the Key Phrase Buffer (KPB)
component. The issue was exposed by a recent change in Zephyr's MMU
mapping for Intel ADSP ACE30, which now catches NULL pointer accesses.

The `devicelist_reset` function previously iterated over the entire
`DEVICE_LIST_SIZE` when clearing items and zeroing pointers, which could
lead to dereferencing NULL pointers. The fix involves iterating only up
to `devlist->count` to ensure that only valid pointers are accessed.

This change prevents potential NULL pointer dereference and ensures the
stability of the KPB component.

Link: thesofproject#9687

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
@lgirdwood

Copy link
Copy Markdown
Member

@tmleman can you check internal CI failure. Thanks !

@kv2019i

kv2019i commented Dec 3, 2024

Copy link
Copy Markdown
Collaborator

SOFCI TEST

@kv2019i

kv2019i commented Dec 3, 2024

Copy link
Copy Markdown
Collaborator

SOFCI TEST

@lgirdwood
lgirdwood merged commit d9bef48 into thesofproject:main Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants