AFLplusplus / AFLplusplus/LibAFL

pthread_spin_* family of functions are not always available

Open
#2,414 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
2.6k
Forks
481
Avg merge
2d 30m
Merged PRs (30d)
16

Description

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 https://github.com/Zofyan/LibAFL-bzero-patch/commit/ffab1c5f41cddeda261c65ab5a54d9396959d32e

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.