Skip to content
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

poll: fix thread_cancel() caused poll used after free #11811

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GUIDINGLI
Copy link
Contributor

Summary

poll: fix thread_cancel() caused poll used after free

    pthread 0          pthread1
    fd 0
    poll_setup
    wait
                       cancel(thread 0)
                       fd 0 close
                       fd 0 notify (sem used after free)
    poll_teardown

Resolve:
Use pthread_cleanup / tls_cleanup to fix this

Impact

POLL

Testing

SIM

@xiaoxiang781216
Copy link
Contributor

@liguiding Please rebase to the last master which fix the ci broken.

Signed-off-by: ligd <liguiding1@xiaomi.com>
pthread 0          pthread1
fd 0
poll_setup
wait
                   cancel(thread 0)
                   fd 0 close
                   fd 0 notify (sem used after free)
poll_teardown

Signed-off-by: ligd <liguiding1@xiaomi.com>
@davids5
Copy link
Contributor

davids5 commented Mar 5, 2024

@GUIDINGLI Is CONFIG_PTHREAD_CLEANUP_STACKSIZE->CONFIG_TLS_NCLEANUP going to break everyone's out of repo code?
Should it be marked as a breaking change?

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.

None yet

3 participants