Skip to content

push to stable #2511

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

Merged
merged 11 commits into from
Aug 5, 2025
Merged

push to stable #2511

merged 11 commits into from
Aug 5, 2025

Conversation

vanhauser-thc
Copy link
Member

No description provided.

lhywk and others added 11 commits July 26, 2025 09:08
Fix null pointer dereference in check_sync_fuzzers
Fix file descriptor leak in get_binary_hash
After c8d1b66 it failed like:

     ===>  Building for afl++-llvm-4.33.c
     [*] Compiling AFL++ for OS FreeBSD on ARCH amd64
     [+] ZLIB detected
     [*] Checking for the default compiler cc...
     [*] Testing the PATH environment variable...
     [*] Checking for the ability to compile x86 code...
     [+] shmat seems to be working.
     [+] Python 3.11.12 support seems to be working.
     [+] Everything seems to be working, ready to compile. (clang version 19.1.7)
     clang19 -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -g -Wno-pointer-sign -Wno-variadic-macros -Wall -Wextra -Wno-pointer-arith -fPIC -I include/ -DAFL_PATH=\"/usr/local/afl++-llvm/lib/afl\" -DBIN_PATH=\"/usr/local/afl++-llvm/bin\" -DDOC_PATH=\"/usr/local/afl++-llvm/share/doc/afl\" -I /usr/local/include/ -pthread -flto=full -DHAVE_ZLIB -c src/afl-common.c -o src/afl-common.o
     clang19 -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -g -Wno-pointer-sign -Wno-variadic-macros -Wall -Wextra -Wno-pointer-arith -fPIC -I include/ -DAFL_PATH=\"/usr/local/afl++-llvm/lib/afl\" -DBIN_PATH=\"/usr/local/afl++-llvm/bin\" -DDOC_PATH=\"/usr/local/afl++-llvm/share/doc/afl\" -I /usr/local/include/ -pthread -flto=full -DHAVE_ZLIB -c src/afl-sharedmem.c -o src/afl-sharedmem.o
     In file included from src/afl-common.c:28:
     include/forkserver.h:191:3: error: unknown type name 'uid_t'
       191 |   uid_t  uid;
           |   ^
     include/forkserver.h:193:3: error: unknown type name 'pid_t'
       193 |   pid_t  gid;
           |   ^
     include/forkserver.h:195:3: error: unknown type name 'pid_t'
       195 |   pid_t *supl_gids;
           |   ^
     include/forkserver.h:197:3: error: unknown type name 'mode_t'; did you mean '__mode_t'?
       197 |   mode_t perm;
           |   ^~~~~~
           |   __mode_t
     /usr/include/sys/_types.h:127:20: note: '__mode_t' declared here
       127 | typedef __uint16_t      __mode_t;       /* permissions */
           |                         ^
     4 errors generated.
     gmake: *** [GNUmakefile:475: src/afl-common.o] Error 1
     gmake: *** Waiting for unfinished jobs....
Fix incorrect pointer arithmetic in afl_resize_map_buffers()
…T_BUILD is set

The testing fails in FreeBSD jails if allow.sysvipc isn't set to 1 (default):

    [*] Testing the CC wrapper and instrumentation output...
    unset AFL_USE_ASAN AFL_USE_MSAN AFL_INST_RATIO AFL_LLVM_ALLOWLIST AFL_LLVM_DENYLIST; ASAN_OPTIONS=detect_leaks=0 AFL_QUIET=1 AFL_PATH=. AFL_LLVM_LAF_ALL=1 ./afl-cc -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -g -Wno-pointer-sign -Wno-variadic-macros -Wall -Wextra -Wno-pointer-arith -fPIC -I include/ -DAFL_PATH=\"/usr/local/afl++-llvm/lib/afl\" -DBIN_PATH=\"/usr/local/afl++-llvm/bin\" -DDOC_PATH=\"/usr/local/afl++-llvm/share/doc/afl\" -I /usr/local/include/ -pthread -Wall -g -Wno-cast-qual -Wno-variadic-macros -Wno-pointer-sign -I ./include/ -I ./instrumentation/ -DAFL_PATH=\"/usr/local/afl++-llvm/lib/afl\" -DBIN_PATH=\"/usr/local/afl++-llvm/bin\" -DLLVM_BINDIR=\"/usr/local/llvm19/bin\" -DVERSION=\"++4.33c\" -DLLVM_LIBDIR=\"/usr/local/llvm19/lib\" -DLLVM_VERSION=\"19.1.7\" -DAFL_CLANG_FLTO=\"-flto=full\" -DAFL_REAL_LD=\"/usr/local/llvm19/bin/ld.lld\" -DAFL_CLANG_LDPATH=\"1\" -DAFL_CLANG_FUSELD=\"1\" -DCLANG_BIN=\"clang19\" -DCLANGPP_BIN=\"clang++19\" -DUSE_BINDIR=0 -Wno-unused-function -Wno-deprecated  ./test-instr.c -o test-instr  -fstack-protector-strong  -L /usr/local/lib/ -lpthread -lm -lz
    ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr0 ./test-instr < /dev/null

    [-]  SYSTEM ERROR : shmget() failed, try running afl-system-config
        Stop location : afl_shm_init(), src/afl-sharedmem.c:303
           OS message : Function not implemented
    gmake[1]: *** [GNUmakefile.llvm:559: test_build] Error 1

Setting AFL_NO_TEST_BUILD=1 allows to build afl++ packages in
poudriere without having to change the jail settings.

Without setting AFL_NO_TEST_BUILD the generated packages are
incomplete:

    fk@test-vm ~/git/privoxy $/usr/local/afl++-llvm/bin/afl-cc --version

    [-] PROGRAM ABORT : Unable to find 'afl-compiler-rt.o'. Please set the AFL_PATH environment variable.
             Location : find_built_deps(), src/afl-cc.c:594
GNUmakefile.llvm: Turn the test_build target into a NOP if AFL_NO_TEST_BUILD is set
@vanhauser-thc vanhauser-thc merged commit b89727b into stable Aug 5, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants