AFLplusplus / AFLplusplus/LibAFL

pthread_spin_* family of functions are not always available

Offen
#2,414 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Rust
Sterne
2.6k
Forks
481
Ø Merge
2 T. 30 Min.
Gemergte PRs (30 T.)
16

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.