Skip to content

[Bug] NULL Dereference occurs in Endpoint Halt when Interface is Unmapped#14

Open
hkpeprah wants to merge 1 commit intoweston-embedded:developfrom
hkpeprah:ford/bug/null-dereference
Open

[Bug] NULL Dereference occurs in Endpoint Halt when Interface is Unmapped#14
hkpeprah wants to merge 1 commit intoweston-embedded:developfrom
hkpeprah:ford/bug/null-dereference

Conversation

@hkpeprah
Copy link
Copy Markdown

@hkpeprah hkpeprah commented Mar 6, 2026

[Bug] NULL Dereference occurs in Endpoint Halt when Interface is Unmapped

Overview

When USBD_IF_RefGet() returns NULL, we still attempt to dereference it into p_alt_if, leading to a NULL pointer deference and crash. This scenario happens when there is a race between USB bus resets and endpoint requests, leading to the host sending a control request targeting an endpoint right as the device is resetting or reconfiguring.

When `USBD_IF_RefGet()` returns `NULL`, we still attempt to dereference it
into `p_alt_if`, leading to a `NULL` pointer deference and crash. This
scenario happens when there is a race between USB bus resets and endpoint
requests, leading to the host sending ac ontrol request targeting an
endpoint right as the device is resetting or reconfiguring.
@hkpeprah
Copy link
Copy Markdown
Author

hkpeprah commented Mar 6, 2026

@wes-jmagasrevy Would you be able to take a look at this?

@wes-jmagasrevy
Copy link
Copy Markdown
Member

@wes-fflores

@wes-fflores
Copy link
Copy Markdown
Member

Hello hkpeprah,
Could you please provide the steps to replicate this issue using one of our standard examples?
Which USBD driver are you using?

@hkpeprah
Copy link
Copy Markdown
Author

We are using the Kinetis KXX driver: https://github.com/weston-embedded/uC-USBD/tree/develop/Drivers/Kinetis_Kxx. I'll attempt with one of the examples to reproduce.

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.

3 participants