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

afl++ build is broken on openssl_x509 #110

Closed
jonathanmetzman opened this issue Mar 16, 2020 · 4 comments · Fixed by AFLplusplus/AFLplusplus#269
Closed

afl++ build is broken on openssl_x509 #110

jonathanmetzman opened this issue Mar 16, 2020 · 4 comments · Fixed by AFLplusplus/AFLplusplus#269
Labels
bug Something isn't working

Comments

@jonathanmetzman
Copy link
Contributor

CC @andreafioraldi

Similar to #107 CI successfully built openssl_x509 with AFL++ but failed to do so on 2020-03-11.

The build fails with this error:

/afl/afl-clang-fast  -Iinclude  -pthread -m64 -fno-omit-frame-pointer -g -Wa,--noexecstack -Qunused-arguments -pthread -Wl,--no-as-needed -Wl,-ldl -Wl,-lm -Wno-unused-command-line-argument -O2 -pthread -Wno-unus
ed-command-line-argument -O2 -fno-sanitize=alignment  -DPEDANTIC -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -MMD -MF test/buildtest_c_e_os2-bin-buildtest_e_os2.d.tmp -MT test/buildtest_c_e_os2-bin-buildtest_e_os
2.o -c -o test/buildtest_c_e_os2-bin-buildtest_e_os2.o test/buildtest_e_os2.c
test/p_test-dso-p_test.o: In function `OSSL_provider_init':
/src/openssl/test/p_test.c:(.text+0x2b): undefined reference to `__afl_area_ptr'
/src/openssl/test/p_test.c:(.text+0x44): undefined reference to `__afl_prev_loc'
/src/openssl/test/p_test.c:(.text+0x7c): undefined reference to `__afl_prev_loc'
test/p_test-dso-p_test.o: In function `p_get_params':
/src/openssl/test/p_test.c:(.text+0x189): undefined reference to `__afl_prev_loc'
/src/openssl/test/p_test.c:(.text+0x198): undefined reference to `__afl_area_ptr'
/src/openssl/test/p_test.c:57: undefined reference to `__afl_prev_loc'
/src/openssl/test/p_test.c:57: undefined reference to `__afl_area_ptr'
/src/openssl/test/p_test.c:93: undefined reference to `__afl_prev_loc'
/src/openssl/test/p_test.c:93: undefined reference to `__afl_area_ptr'
/src/openssl/test/p_test.c:(.text+0x3e8): undefined reference to `__afl_prev_loc'
/src/openssl/test/p_test.c:(.text+0x3f7): undefined reference to `__afl_area_ptr'
clang-10: error: linker command failed with exit code 1 (use -v to see invocation

I will try to investigate the fix for this as well as if there is a way to make CI more likely to catch failures that happen in production.

@jonathanmetzman
Copy link
Contributor Author

I think #115 is why this wasn't caught by CI

@andreafioraldi
Copy link
Contributor

Super strange, seems that afl-llvm-rt is not linked in the test.

@alifahmed
Copy link
Contributor

This can be fixed by skipping the check of maybe_linking flag in afl-clang-fast.c.
Irrespective of the value of maybe_linking, the afl-llvm-rt.o (and its 32/64 variants) should be added to the cc_params.

@inferno-chromium inferno-chromium added the bug Something isn't working label Mar 21, 2020
@andreafioraldi
Copy link
Contributor

I fixed it in the dev branch https://github.com/AFLplusplus/AFLplusplus/tree/dev with the solution proposed by @alifahmed . Waiting travis, then I'll merge it and update fuzzbench.

andreafioraldi added a commit to andreafioraldi/AFL-1 that referenced this issue Mar 23, 2020
Some targets needs to include afl-llvm-rt.o not only when linking, see google/fuzzbench#110.
This change seems to not break nothing in AFL++.
jonathanmetzman pushed a commit to google/AFL that referenced this issue Mar 24, 2020
Some targets needs to include afl-llvm-rt.o not only when linking, see google/fuzzbench#110.
This change seems to not break nothing in AFL++.
yifengchen-cc pushed a commit to yifengchen-cc/fuzzbench that referenced this issue Apr 8, 2020
jonathanmetzman pushed a commit that referenced this issue May 26, 2020
* Remove dislocator from AFL++

One of the possible reasons of the decrement in performance of AFL++ in the lastest report is due to the missing AFL_ALIGNED_ALLOC env var. Without this variable, dislocator's malloc does not ensure that the returned address is aligned to max_aligned_t (as required by posix) but it is able, in this way, to catch more bugs.
Many applications checks for this alignment and this may cause an early exit in the application (and so a low coverage).
I completely remove dislocator to better understand what is happening in the next run of the experiments.

* update AFL++ to fix #110

* afl++ cmplog

* fix afl++ schedules flags error

* unification of aflplusplus confs

* update fuzzers.yml

* make presubmit happy

* add marc changes from #229

* presubmit

* add also ngram2/4

* runner for cmplog

* update commit

* prepare new features

* new variants

* add support for ngram5

* add ctx variants

* format

* less lint more fire

* seriously? one instead of two spaces is an issue?

* add lto variant

* update checkout

* fix build lines

* formatting

* libfuzzer valueprofiles variant

* formatting

* formatting

* remove old afl++ variants

* update git

* add afl++ variants

* final afl++ variants

* remove valuprofile and old symlink

* fix laf-intel crash

* update commit

* fix for older llvm versions

* fix bug in laf-intel for sqlite3 testcase

* switch afl++ variants

* remove LTO

* fix fuckup in main fuzzer.py

* update git

* LTO submit

* lto update

* copy llvm11 c++ libs to targets

* fix LTO and add 2nd LTO variant

* remove 2 fuzzer variants to make space for LTO

* LTO compiles curl target now, ensure flags are empty

* fix tcpdump benchmark

* jsoncpp needs a dynamic map too :-(

* build and run all benchmarks

* switch to tracepcguard

* Revert "switch to tracepcguard"

This reverts commit 782f555.

* switch from instrim to tracepcguard

* fix a fuzzer

* fix formatting

* remove temporary fuzzers

* fix generate report document

* fix report document, add report alternative

* remove report changes

* remove report changes

* next variants

* Revert "next variants"

This reverts commit c551d90.

* add new variants

* nitpicks

* remove fuzzer variants

* remove variants from fuzzer.yaml

* add optimal variant

* formatting

* fix builds

* more build fixes

* more build fixes

* more build fixes

* more build fixes

* fix builds

* various fixes and enhancements

* formatting

* formatting

* fix. too tired

* fix. too tired

* add splitting floats to laf

* enable lto for the relevant targets again after fixing bugs in laf+cmplog

* freetype2 needs dynamic map

* fix target compilation

* fix target compilation

* final touches for now

* done performance tuning

* add shmem variant

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
Co-authored-by: root <root@localhost.localdomain>
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

Successfully merging a pull request may close this issue.

4 participants