AFLplusplus / AFLplusplus

The fuzzer afl++ is afl with community patches, qemu 5.1 upgrade, collision-free coverage, enhanced laf-intel & redqueen, AFLfast++ power schedules, MOpt mutators, unicorn_mode, and a lot more!

Home Page:https://aflplus.plus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regression: i386 not supported anymore?

elboulangero opened this issue · comments

Hello, I noticed a regression in the Debian CI tests, as can be seen at https://ci.debian.net/packages/a/aflplusplus/testing/i386/. In short, tests for i386 used to pass in 4.08c, and fails with 4.20c.

I reproduced the error in a i386 container:

# dpkg --print-architecture
i386

# AFL_DEBUG=1 afl-gcc     test-instr.c   -o test-instr
[D] DEBUG: Trying /usr/bin/SanitizerCoveragePCGUARD.so
[D] DEBUG: Trying /usr/bin/../lib/afl/SanitizerCoveragePCGUARD.so
[D] DEBUG: Trying /usr/bin/SanitizerCoverageLTO.so
[D] DEBUG: Trying /usr/bin/../lib/afl/SanitizerCoverageLTO.so
[D] DEBUG: Trying /usr/bin/cmplog-routines-pass.so
[D] DEBUG: Trying /usr/bin/../lib/afl/cmplog-routines-pass.so
[D] DEBUG: Trying /usr/bin/afl-gcc-pass.so
[D] DEBUG: Trying /usr/bin/../lib/afl/afl-gcc-pass.so
[D] DEBUG: Trying /usr/bin/afl-compiler-rt.o
[D] DEBUG: Trying /usr/bin/../lib/afl/afl-compiler-rt.o
[D] DEBUG: rt=/usr/bin/../lib/afl/afl-compiler-rt.o

[-] PROGRAM ABORT : afl-gcc is not available on your platform!
         Location : mode_final_checkout(), src/afl-cc.c:1214

For comparison, the same test on a amd64 system works, and has two extra lines at the beginning:

[D] DEBUG: Trying /usr/bin/afl-as
[D] DEBUG: Trying /usr/bin/../lib/afl/afl-as

It seems that afl-cc doesn't look for afl-as on a i386 system, which is confirmed by this commit:

136feba#diff-4d5524fb8c50110c0f8f6d155c6e605f1b2627e7f09bafa1e6f4a47ff173192eR507

The test #if defined(__x86_64__) was added, so it disabled afl-cc for __i386__.

Is that intentional?

It is not intentional but it works fine in our docker container?

You mean the GitHub CI, eg. https://github.com/AFLplusplus/AFLplusplus/actions/runs/8987471892? I have the impression that the CI runs only for the amd64 architecture, while the failing test that I report here runs on a i386 machine.

I applied the patch in #2083, after that it works for me:

# dpkg --print-architecture
i386

# AFL_DEBUG=1 afl-gcc     test-instr.c   -o test-instr
[D] DEBUG: Trying /usr/bin/afl-as
[D] DEBUG: Trying /usr/bin/../lib/afl/afl-as
[D] DEBUG: Trying /usr/bin/SanitizerCoveragePCGUARD.so
[D] DEBUG: Trying /usr/bin/../lib/afl/SanitizerCoveragePCGUARD.so
[D] DEBUG: Trying /usr/bin/SanitizerCoverageLTO.so
[D] DEBUG: Trying /usr/bin/../lib/afl/SanitizerCoverageLTO.so
[D] DEBUG: Trying /usr/bin/cmplog-routines-pass.so
[D] DEBUG: Trying /usr/bin/../lib/afl/cmplog-routines-pass.so
[D] DEBUG: Trying /usr/bin/afl-gcc-pass.so
[D] DEBUG: Trying /usr/bin/../lib/afl/afl-gcc-pass.so
[D] DEBUG: Trying /usr/bin/afl-compiler-rt.o
[D] DEBUG: Trying /usr/bin/../lib/afl/afl-compiler-rt.o
[D] DEBUG: rt=/usr/bin/../lib/afl/afl-compiler-rt.o
afl-cc++4.20c by Michal Zalewski, Laszlo Szekeres, Marc Heuse - mode: GCC-GCC
[!] WARNING: You are using outdated instrumentation, install LLVM and/or gcc-plugin and use afl-clang-fast/afl-clang-lto/afl-gcc-fast instead!
[D] DEBUG: cd '/work/debian/src/pkg-security-team/aflplusplus'; 'afl-gcc' 'test-instr.c' '-o' 'test-instr'
[D] DEBUG: Trying /usr/bin/afl-as
[D] DEBUG: Trying /usr/bin/../lib/afl/afl-as
[D] DEBUG: cd '/work/debian/src/pkg-security-team/aflplusplus'; 'gcc' '-B' '/usr/bin/../lib/afl' 'test-instr.c' '-o' 'test-instr' '-fPIC' '-g' '-O3' '-funroll-loops' '-D__AFL_COMPILER=1' '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1' '-D__AFL_COVERAGE()=int __afl_selective_coverage = 1;void __afl_coverage_discard();void __afl_coverage_skip();void __afl_coverage_on();void __afl_coverage_off();' '-D__AFL_COVERAGE_START_OFF()=int __afl_selective_coverage_start_off = 1;' '-D__AFL_COVERAGE_ON()=__afl_coverage_on()' '-D__AFL_COVERAGE_OFF()=__afl_coverage_off()' '-D__AFL_COVERAGE_DISCARD()=__afl_coverage_discard()' '-D__AFL_COVERAGE_SKIP()=__afl_coverage_skip()' '(null)'
afl-as++4.20c by Michal Zalewski
[+] Instrumented 20 locations (32-bit, non-hardened mode, ratio 100%).
/usr/bin/ld: /tmp/cchIqar5.o: warning: relocation in read-only section `.text'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE

thank you!