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

pthread_spin_* family of functions are not always available #2414

Open
Zofyan opened this issue Jul 17, 2024 · 0 comments
Open

pthread_spin_* family of functions are not always available #2414

Zofyan opened this issue Jul 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Zofyan
Copy link
Contributor

Zofyan commented Jul 17, 2024

malloc.c in libqasan contains a conditional compilation that causes libqasan to use either spin locks or mutex locks. I am unsure on how it is detected which one should be used exactly, but I found that spin function are often not available on some firmware. This firmware can be used to reproduce the issue https://archive.org/details/Linksys_EA6300_1.1.40_e2ec7. The libraries do not contain the spin functions but libqasan does expect them.

I do realize that the issue is most likely with the cross compiler used, causing libqasan to expect these functions; but it is quite difficult to track down the right compiler for ARM binaries with limited information. For my project I forced LibAFL to always used mutex locks.

With this bug report I wanted to bring this to your attention and maybe it is worth considering to always use the mutex functions if the slowdown is not signficant, so that libqasan may be more compiler agnostic and work with more unknown firmware/binaries.

My fix is in this commit Zofyan@ffab1c5

@Zofyan Zofyan added the bug Something isn't working label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant