security/afl++: Update to 2.63c

Changes:	https://github.com/AFLplusplus/AFLplusplus/releases/tag/2.63c
This commit is contained in:
Tobias Kortkamp
2020-04-10 05:41:51 +00:00
parent 2b1f0d5d43
commit 0c6df3fe83
6 changed files with 129 additions and 29 deletions

View File

@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= afl
PORTVERSION= 2.62c
PORTVERSION= 2.63c
CATEGORIES= security
PKGNAMESUFFIX= ++
@@ -15,13 +15,15 @@ LICENSE_FILE= ${WRKSRC}/docs/COPYING
ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc64
ONLY_FOR_ARCHS_REASON= uses x86-only instrumentation or requires complete LLVM support
BUILD_DEPENDS= ginstall:sysutils/coreutils
TEST_DEPENDS= bash:shells/bash
USES= gmake tar:tgz
USE_GITHUB= yes
GH_ACCOUNT= vanhauser-thc
GH_ACCOUNT= AFLplusplus
GH_PROJECT= AFLplusplus
MAKEFILE= GNUmakefile
MAKE_ARGS= STRIP_CMD="${STRIP_CMD}"
ALL_TARGET= all libtokencap
INSTALL_TARGET= install-strip
@@ -29,6 +31,8 @@ TEST_TARGET= test_build
CONFLICTS_INSTALL= afl
BINARY_ALIAS= install=ginstall
OPTIONS_DEFINE= DEBUG DOCS EXAMPLES GCC LIBDISLOCATOR LLVM PYTHON
OPTIONS_DEFAULT= GCC LIBDISLOCATOR LLVM PYTHON
@@ -56,7 +60,8 @@ LIBDISLOCATOR_ALL_TARGET= libdislocator
LLVM_BUILD_DEPENDS= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT}
LLVM_RUN_DEPENDS= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT}
LLVM_MAKE_ARGS= CC=clang${LLVM_DEFAULT} \
LLVM_MAKE_ARGS= _AFL_REAL_LD=${LOCALBASE}/bin/ld.lld${LLVM_DEFAULT} \
CC=clang${LLVM_DEFAULT} \
CXX=clang++${LLVM_DEFAULT} \
LLVM_CONFIG=llvm-config${LLVM_DEFAULT}
LLVM_ALL_TARGET= llvm_mode
@@ -86,15 +91,14 @@ post-patch:
# jails works by default. afl needs shmget() which usually isn't
# available in jails.
@${REINPLACE_CMD} 's@^\(all.*\) test_build@\1@' \
${WRKSRC}/Makefile \
${WRKSRC}/gcc_plugin/Makefile \
${WRKSRC}/llvm_mode/Makefile
${WRKSRC}/${MAKEFILE} \
${WRKSRC}/gcc_plugin/GNUmakefile \
${WRKSRC}/llvm_mode/GNUmakefile
.if ${ARCH} == "i386"
@${REINPLACE_CMD} 's@\( as_params\[0\] = afl_as ? afl_as : \)\(.*\)@\1(u8*)"${LOCALBASE}/bin/as";@' \
${WRKSRC}/src/afl-as.c
.endif
@${REINPLACE_CMD} '/export AFL_CC/d' ${WRKSRC}/test/test.sh
@${ECHO_CMD} "include ${FILESDIR}/Makefile.extra" >> ${WRKSRC}/Makefile
@${ECHO_CMD} "include ${FILESDIR}/Makefile.extra" >> ${WRKSRC}/${MAKEFILE}
post-patch-LLVM-on:
@${REINPLACE_CMD} \
@@ -110,6 +114,11 @@ post-install:
${FIND} lib/afl -name 'argvfuzz*.so' -or -name 'socketfuzz*.so' \
>> ${TMPPLIST}
post-install-EXAMPLES-on:
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/custom_mutators
@cd ${WRKSRC}/examples && \
${COPYTREE_SHARE} custom_mutators ${STAGEDIR}${EXAMPLESDIR}
post-install-GCC-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}/gcc_plugin
${INSTALL_MAN} ${WRKSRC}/gcc_plugin/README.* \
@@ -125,13 +134,8 @@ post-install-LLVM-on:
${INSTALL_MAN} ${WRKSRC}/llvm_mode/README.* \
${STAGEDIR}${DOCSDIR}/llvm_mode
post-install-PYTHON-on:
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/python_mutators
@cd ${WRKSRC}/examples && \
${COPYTREE_SHARE} python_mutators ${STAGEDIR}${EXAMPLESDIR}
post-test:
# libtokencap test might require security.bsd.unprivileged_proc_debug=1
@cd ${WRKSRC}/test && ./test.sh
@cd ${WRKSRC}/test && ${SETENV} AFL_PATH=${WRKSRC} ./test.sh
.include <bsd.port.mk>

View File

@@ -1,3 +1,3 @@
TIMESTAMP = 1582866765
SHA256 (vanhauser-thc-AFLplusplus-2.62c_GH0.tar.gz) = cde181ac733aa3a1212ffcb494bb9306a2086c7521fb006719b0e15cd8015c63
SIZE (vanhauser-thc-AFLplusplus-2.62c_GH0.tar.gz) = 1272000
TIMESTAMP = 1586436254
SHA256 (AFLplusplus-AFLplusplus-2.63c_GH0.tar.gz) = 9c314899015620a9e57054f15f3fed29104c0f762098e30707267ef70be1add8
SIZE (AFLplusplus-AFLplusplus-2.63c_GH0.tar.gz) = 1326005

View File

@@ -5,7 +5,7 @@ install-strip: install
@-${STRIP_CMD} ${DESTDIR}${BIN_PATH}/afl-clang-fast
@-${STRIP_CMD} ${DESTDIR}${BIN_PATH}/afl-gcc-fast
# XXX: strip(1) trips up when stripping all things in HELPER_PATH in one go?
@cd ${DESTDIR}${HELPER_PATH} && for f in afl-as *.so; do ${STRIP_CMD} $${f}; done
@cd ${DESTDIR}${HELPER_PATH} && for f in afl-as afl-ld *.so; do ${STRIP_CMD} $${f}; done
libdislocator:
$(MAKE) -C libdislocator CFLAGS="-I../include ${CFLAGS}"
@@ -14,10 +14,10 @@ libtokencap:
$(MAKE) -C libtokencap
llvm_mode:
$(MAKE) -C llvm_mode
$(MAKE) -C llvm_mode AFL_REAL_LD="$(_AFL_REAL_LD)"
test_llvm_mode:
$(MAKE) -C llvm_mode test_build
$(MAKE) -C llvm_mode AFL_REAL_LD="$(_AFL_REAL_LD)" test_build
gcc_plugin:
$(MAKE) -C gcc_plugin CC="${GCC}" CXX="${GXX}"

View File

@@ -0,0 +1,70 @@
Chicken and egg: Make tests runnable without afl++ already installed.
[!] LTO llvm_mode failed
clang-9: error: invalid linker name in argument '-fuse-ld=/usr/local/lib/afl/afl-ld'
[!] llvm_mode LTO persistent mode feature compilation failed
Setting AFL_CC is not necessary since all programs should be compiled
with the right settings already.
--- test/test.sh.orig 2020-04-09 08:23:37 UTC
+++ test/test.sh
@@ -220,14 +220,6 @@ test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" =
$ECHO "$BLUE[*] Testing: llvm_mode, afl-showmap, afl-fuzz, afl-cmin and afl-tmin"
test -e ../afl-clang-fast -a -e ../split-switches-pass.so && {
- # on FreeBSD need to set AFL_CC
- test `uname -s` = 'FreeBSD' && {
- if type clang >/dev/null; then
- export AFL_CC=`command -v clang`
- else
- export AFL_CC=`$LLVM_CONFIG --bindir`/clang
- fi
- }
../afl-clang-fast -o test-instr.plain ../test-instr.c > /dev/null 2>&1
AFL_HARDEN=1 ../afl-clang-fast -o test-compcov.harden test-compcov.c > /dev/null 2>&1
test -e test-instr.plain && {
@@ -398,16 +390,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass
$ECHO "$BLUE[*] Testing: LTO llvm_mode"
test -e ../afl-clang-lto -a -e ../afl-llvm-lto-instrumentation.so && {
- # on FreeBSD need to set AFL_CC
- test `uname -s` = 'FreeBSD' && {
- if type clang >/dev/null; then
- export AFL_CC=`command -v clang`
- else
- export AFL_CC=`$LLVM_CONFIG --bindir`/clang
- fi
- }
-
- ../afl-clang-lto -o test-instr.plain ../test-instr.c > /dev/null 2>&1
+ ../afl-clang-lto -fuse-ld="$(realpath ../afl-ld)" -o test-instr.plain ../test-instr.c > /dev/null 2>&1
test -e test-instr.plain && {
$ECHO "$GREEN[+] llvm_mode LTO compilation succeeded"
echo 0 | ../afl-showmap -m ${MEM_LIMIT} -o test-instr.plain.0 -r -- ./test-instr.plain > /dev/null 2>&1
@@ -452,7 +435,7 @@ test -e ../afl-clang-lto -a -e ../afl-llvm-lto-instrum
# CODE=1
# }
# rm -f test-compcov test.out whitelist.txt
- ../afl-clang-lto -o test-persistent ../examples/persistent_demo/persistent_demo.c > /dev/null 2>&1
+ ../afl-clang-lto -fuse-ld="$(realpath ../afl-ld)" -o test-persistent ../examples/persistent_demo/persistent_demo.c > /dev/null 2>&1
test -e test-persistent && {
echo foo | ../afl-showmap -o /dev/null -q -r ./test-persistent && {
$ECHO "$GREEN[+] llvm_mode LTO persistent mode feature works correctly"
@@ -472,8 +455,6 @@ test -e ../afl-clang-lto -a -e ../afl-llvm-lto-instrum
$ECHO "$BLUE[*] Testing: gcc_plugin"
test -e ../afl-gcc-fast -a -e ../afl-gcc-rt.o && {
- SAVE_AFL_CC=${AFL_CC}
- export AFL_CC=`command -v gcc`
../afl-gcc-fast -o test-instr.plain.gccpi ../test-instr.c > /dev/null 2>&1
AFL_HARDEN=1 ../afl-gcc-fast -o test-compcov.harden.gccpi test-compcov.c > /dev/null 2>&1
test -e test-instr.plain.gccpi && {
@@ -575,7 +556,6 @@ test -e ../afl-gcc-fast -a -e ../afl-gcc-rt.o && {
CODE=1
}
rm -f test-persistent
- export AFL_CC=${SAVE_AFL_CC}
} || {
$ECHO "$YELLOW[-] gcc_plugin not compiled, cannot test"
INCOMPLETE=1

View File

@@ -7,4 +7,4 @@ fuzzed code.
afl++ is a fork of afl that incorporates all community patches into
a single source distribution.
WWW: https://github.com/vanhauser-thc/AFLplusplus
WWW: https://aflplus.plus/

View File

@@ -3,6 +3,8 @@ bin/afl-analyze
%%X86%%bin/afl-clang++
%%LLVM%%bin/afl-clang-fast
%%LLVM%%bin/afl-clang-fast++
%%LLVM%%bin/afl-clang-lto
%%LLVM%%bin/afl-clang-lto++
%%GCC%%bin/afl-g++-fast
%%GCC%%bin/afl-gcc-fast
bin/afl-cmin
@@ -19,12 +21,18 @@ bin/afl-whatsup
%%X86%%lib/afl/afl-as
%%GCC%%lib/afl/afl-gcc-pass.so
%%GCC%%lib/afl/afl-gcc-rt.o
%%LLVM%%lib/afl/afl-ld
%%LLVM%%lib/afl/afl-llvm-lto-instrumentation.so
%%LLVM%%lib/afl/afl-llvm-lto-whitelist.so
%%LLVM%%lib/afl/afl-llvm-pass.so
%%X86%%%%LLVM%%lib/afl/afl-llvm-rt-32.o
%%LLVM%%lib/afl/afl-llvm-rt-64.o
%%LLVM%%lib/afl/afl-llvm-rt.o
%%X86%%lib/afl/as
%%LLVM%%lib/afl/cmplog-instructions-pass.so
%%LLVM%%lib/afl/cmplog-routines-pass.so
%%LLVM%%lib/afl/compare-transform-pass.so
%%LLVM%%lib/afl/ld
%%LIBDISLOCATOR%%lib/afl/libdislocator.so
lib/afl/libtokencap.so
%%LLVM%%lib/afl/libLLVMInsTrim.so
@@ -34,6 +42,8 @@ man/man8/afl-analyze.8.gz
man/man8/afl-as.8.gz
%%LLVM%%man/man8/afl-clang-fast.8.gz
%%LLVM%%man/man8/afl-clang-fast++.8.gz
%%LLVM%%man/man8/afl-clang-lto.8.gz
%%LLVM%%man/man8/afl-clang-lto++.8.gz
man/man8/afl-cmin.8.gz
man/man8/afl-cmin.bash.8.gz
man/man8/afl-fuzz.8.gz
@@ -103,10 +113,20 @@ man/man8/afl-whatsup.8.gz
%%PORTDOCS%%%%DOCSDIR%%/PATCHES.md
%%PORTDOCS%%%%DOCSDIR%%/QuickStartGuide.md
%%PORTDOCS%%%%DOCSDIR%%/README.MOpt.md
%%PORTDOCS%%%%DOCSDIR%%/README.cmplog.md
%%PORTDOCS%%%%DOCSDIR%%/README.ctx.md
%%PORTDOCS%%%%DOCSDIR%%/README.instrim.md
%%PORTDOCS%%%%DOCSDIR%%/README.laf-intel.md
%%PORTDOCS%%%%DOCSDIR%%/README.llvm_mode.md
%%PORTDOCS%%%%DOCSDIR%%/README.lto.md
%%PORTDOCS%%%%DOCSDIR%%/README.md
%%PORTDOCS%%%%DOCSDIR%%/README.neverzero.md
%%PORTDOCS%%%%DOCSDIR%%/README.ngram.md
%%PORTDOCS%%%%DOCSDIR%%/README.radamsa.md
%%PORTDOCS%%%%DOCSDIR%%/README.snapshot.md
%%PORTDOCS%%%%DOCSDIR%%/README.whitelist.md
%%PORTDOCS%%%%DOCSDIR%%/binaryonly_fuzzing.md
%%PORTDOCS%%%%DOCSDIR%%/custom_mutator.md
%%PORTDOCS%%%%DOCSDIR%%/custom_mutators.md
%%PORTDOCS%%%%DOCSDIR%%/env_variables.md
%%GCC%%%%PORTDOCS%%%%DOCSDIR%%/gcc_plugin/README.md
%%GCC%%%%PORTDOCS%%%%DOCSDIR%%/gcc_plugin/README.whitelist.md
@@ -116,22 +136,28 @@ man/man8/afl-whatsup.8.gz
%%PORTDOCS%%%%DOCSDIR%%/libtokencap/README.md
%%PORTDOCS%%%%DOCSDIR%%/life_pro_tips.md
%%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.cmplog.md
%%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.ctx.md
%%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.instrim.md
%%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.laf-intel.md
%%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.lto.md
%%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.md
%%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.neverzero.md
%%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.ngram.md
%%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.snapshot.md
%%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.whitelist.md
%%PORTDOCS%%%%DOCSDIR%%/notes_for_asan.md
%%PORTDOCS%%%%DOCSDIR%%/parallel_fuzzing.md
%%PORTDOCS%%%%DOCSDIR%%/perf_tips.md
%%PORTDOCS%%%%DOCSDIR%%/power_schedules.md
%%PYTHON%%%%PORTDOCS%%%%DOCSDIR%%/python_mutators.md
%%PORTDOCS%%%%DOCSDIR%%/sister_projects.md
%%PORTDOCS%%%%DOCSDIR%%/status_screen.md
%%PORTDOCS%%%%DOCSDIR%%/technical_details.md
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/python_mutators/README
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/python_mutators/XmlMutatorMin.py
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/python_mutators/common.py
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/python_mutators/example.py
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/python_mutators/simple-chunk-replace.py
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/python_mutators/wrapper_afl_min.py
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom_mutators/Makefile
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom_mutators/README.md
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom_mutators/XmlMutatorMin.py
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom_mutators/common.py
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom_mutators/custom_mutator_helpers.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom_mutators/example.c
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom_mutators/example.py
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom_mutators/simple-chunk-replace.py
%%PYTHON%%%%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom_mutators/wrapper_afl_min.py