AFLplusplus / AFLplusplus/LibAFL

pthread_spin_* family of functions are not always available

Aperta
#2,414 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Rust
Stelle
2.6k
Fork
481
Merge medio
2g 30m
PR unite (30g)
16

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.