Index: head/security/afl++/Makefile =================================================================== --- head/security/afl++/Makefile (revision 520379) +++ head/security/afl++/Makefile (revision 520380) @@ -1,117 +1,130 @@ # Created by: Fabian Keil # $FreeBSD$ PORTNAME= afl -PORTVERSION= 2.58c +PORTVERSION= 2.59c CATEGORIES= security PKGNAMESUFFIX= ++ MAINTAINER= tobik@FreeBSD.org COMMENT= Fast instrumented fuzzer LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/docs/COPYING # In theory afl supports non-x86 architectures with the LLVM plugin. # This has only been run tested on aarch64 so far. ONLY_FOR_ARCHS= aarch64 amd64 i386 ONLY_FOR_ARCHS_REASON= uses x86-only instrumentation or requires complete LLVM support USES= gmake tar:tgz USE_GITHUB= yes GH_ACCOUNT= vanhauser-thc GH_PROJECT= AFLplusplus MAKE_ARGS= STRIP_CMD="${STRIP_CMD}" -ALL_TARGET= all libdislocator +ALL_TARGET= all libdislocator libtokencap INSTALL_TARGET= install-strip TEST_TARGET= test_build CONFLICTS_INSTALL= afl -OPTIONS_DEFINE= DEBUG DOCS GCC LLVM -OPTIONS_DEFAULT= LLVM +OPTIONS_DEFINE= DEBUG DOCS EXAMPLES GCC LLVM PYTHON +OPTIONS_DEFAULT= LLVM PYTHON # On non-x86 architectures LLVM is mandatory OPTIONS_SLAVE= ${ARCH:Namd64:Ni386:S/${ARCH}/LLVM/} OPTIONS_SUB= yes GCC_DESC= Build GCC plugin and afl-gcc-fast LLVM_DESC= LLVM-based instrumentation +PYTHON_DESC= Python mutators support GCC_BUILD_DEPENDS= gcc${GCC_DEFAULT}:lang/gcc${GCC_DEFAULT} GCC_RUN_DEPENDS= gcc${GCC_DEFAULT}:lang/gcc${GCC_DEFAULT} GCC_MAKE_ARGS= GCC=gcc${GCC_DEFAULT} \ GXX=g++${GCC_DEFAULT} GCC_ALL_TARGET= gcc_plugin GCC_TEST_TARGET= test_gcc_plugin LLVM_BUILD_DEPENDS= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} LLVM_RUN_DEPENDS= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} LLVM_MAKE_ARGS= LLVM_CONFIG=llvm-config${LLVM_DEFAULT} LLVM_ALL_TARGET= llvm_mode LLVM_TEST_TARGET= test_llvm_mode LLVM_BINARY_ALIAS= llvm-config=llvm-config${LLVM_DEFAULT} LLVM_VARS= CC=clang${LLVM_DEFAULT} \ CXX=clang++${LLVM_DEFAULT} +PYTHON_USES= gettext-runtime python:3.7 +PYTHON_MAKE_ARGS_OFF= PYTHON_INCLUDE=/nonexistent + .include .if ${ARCH} == "i386" || ${ARCH} == "amd64" PLIST_SUB+= X86="" .else MAKE_ARGS+= AFL_NO_X86=1 PLIST_SUB+= X86="@comment " .endif .if ${ARCH} == "i386" # Clang i386 emits .cfi_sections which base as(1) doesn't understand BUILD_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils RUN_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils .endif post-patch: # Disable the instrumentation tests to make sure building packages in # 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 .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 post-patch-GCC-on: @${REINPLACE_CMD} \ -e 's|"gcc"|"gcc${GCC_DEFAULT}"|g' \ -e 's|"g\+\+"|"g\+\+${GCC_DEFAULT}"|g' \ ${WRKSRC}/gcc_plugin/afl-gcc-fast.c post-patch-LLVM-on: @${REINPLACE_CMD} \ -e 's|"clang"|"clang${LLVM_DEFAULT}"|g' \ -e 's|"clang\+\+"|"clang\+\+${LLVM_DEFAULT}"|g' \ ${WRKSRC}/llvm_mode/afl-clang-fast.c post-install: - @${MKDIR} ${STAGEDIR}${DOCSDIR}/libdislocator - ${INSTALL_MAN} ${WRKSRC}/libdislocator/README.md \ + @${MKDIR} ${STAGEDIR}${DOCSDIR}/libdislocator \ + ${STAGEDIR}${DOCSDIR}/libtokencap + ${INSTALL_MAN} ${WRKSRC}/libdislocator/README.dislocator.md \ ${STAGEDIR}${DOCSDIR}/libdislocator + ${INSTALL_MAN} ${WRKSRC}/libtokencap/README.tokencap.md \ + ${STAGEDIR}${DOCSDIR}/libtokencap post-install-GCC-on: @${MKDIR} ${STAGEDIR}${DOCSDIR}/gcc_plugin ${INSTALL_MAN} ${WRKSRC}/gcc_plugin/README.* \ ${STAGEDIR}${DOCSDIR}/gcc_plugin post-install-LLVM-on: ${MKDIR} ${STAGEDIR}${DOCSDIR}/llvm_mode ${INSTALL_MAN} ${WRKSRC}/llvm_mode/README.* \ ${STAGEDIR}${DOCSDIR}/llvm_mode +post-install-PYTHON-on: + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/python_mutators + @cd ${WRKSRC} && \ + ${COPYTREE_SHARE} python_mutators ${STAGEDIR}${EXAMPLESDIR} + post-test: +# libtokencap test might require security.bsd.unprivileged_proc_debug=1 @cd ${WRKSRC}/test && ./test.sh .include Index: head/security/afl++/distinfo =================================================================== --- head/security/afl++/distinfo (revision 520379) +++ head/security/afl++/distinfo (revision 520380) @@ -1,3 +1,3 @@ -TIMESTAMP = 1571651123 -SHA256 (vanhauser-thc-AFLplusplus-2.58c_GH0.tar.gz) = d25d6d90062a9e17327bb7bd3e59650e527d00aba85009e578aed6b9896266df -SIZE (vanhauser-thc-AFLplusplus-2.58c_GH0.tar.gz) = 986561 +TIMESTAMP = 1576666209 +SHA256 (vanhauser-thc-AFLplusplus-2.59c_GH0.tar.gz) = 858c81fa6221ef2b8b2a8977a70dc86c2624c23230d0629b3037130fd0d8d685 +SIZE (vanhauser-thc-AFLplusplus-2.59c_GH0.tar.gz) = 1211443 Index: head/security/afl++/files/Makefile.extra =================================================================== --- head/security/afl++/files/Makefile.extra (revision 520379) +++ head/security/afl++/files/Makefile.extra (revision 520380) @@ -1,22 +1,25 @@ -.PHONY: gcc_plugin install-strip libdislocator llvm_mode test_gcc_plugin test_llvm_mode +.PHONY: gcc_plugin install-strip libdislocator libtokencap llvm_mode test_gcc_plugin test_llvm_mode install-strip: install @cd ${DESTDIR}${BIN_PATH} && ${STRIP_CMD} ${PROGS} @-${STRIP_CMD} ${DESTDIR}${BIN_PATH}/afl-clang-fast @-${STRIP_CMD} ${DESTDIR}${BIN_PATH}/afl-gcc-fast @cd ${DESTDIR}${HELPER_PATH} && ${STRIP_CMD} afl-as *.so libdislocator: $(MAKE) -C libdislocator CFLAGS="-I../include ${CFLAGS}" - + +libtokencap: + $(MAKE) -C libtokencap + llvm_mode: $(MAKE) -C llvm_mode test_llvm_mode: $(MAKE) -C llvm_mode test_build gcc_plugin: $(MAKE) -C gcc_plugin CC="${GCC}" CXX="${GXX}" test_gcc_plugin: $(MAKE) -C gcc_plugin CC="${GCC}" CXX="${GXX}" test_build Index: head/security/afl++/pkg-plist =================================================================== --- head/security/afl++/pkg-plist (revision 520379) +++ head/security/afl++/pkg-plist (revision 520380) @@ -1,119 +1,128 @@ bin/afl-analyze %%X86%%bin/afl-clang %%X86%%bin/afl-clang++ %%LLVM%%bin/afl-clang-fast %%LLVM%%bin/afl-clang-fast++ %%GCC%%bin/afl-g++-fast %%GCC%%bin/afl-gcc-fast bin/afl-cmin bin/afl-fuzz %%X86%%bin/afl-g++ %%X86%%bin/afl-gcc bin/afl-gotcpu bin/afl-plot bin/afl-showmap bin/afl-system-config bin/afl-tmin 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-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/compare-transform-pass.so lib/afl/libdislocator.so +lib/afl/libtokencap.so %%LLVM%%lib/afl/libLLVMInsTrim.so %%LLVM%%lib/afl/split-compares-pass.so %%LLVM%%lib/afl/split-switches-pass.so %%LLVM%%man/man8/afl-clang-fast.8.gz %%LLVM%%man/man8/afl-clang-fast++.8.gz man/man8/afl-cmin.8.gz man/man8/afl-fuzz.8.gz %%GCC%%man/man8/afl-g++-fast.8.gz %%GCC%%man/man8/afl-gcc-fast.8.gz man/man8/afl-gcc.8.gz man/man8/afl-gotcpu.8.gz man/man8/afl-plot.8.gz man/man8/afl-showmap.8.gz man/man8/afl-system-config.8.gz man/man8/afl-tmin.8.gz man/man8/afl-whatsup.8.gz %%DATADIR%%/README.md %%DATADIR%%/README.testcases %%DATADIR%%/archives/common/ar/small_archive.a %%DATADIR%%/archives/common/bzip2/small_archive.bz2 %%DATADIR%%/archives/common/cab/small_archive.cab %%DATADIR%%/archives/common/compress/small_archive.Z %%DATADIR%%/archives/common/cpio/small_archive.cpio %%DATADIR%%/archives/common/gzip/small_archive.gz %%DATADIR%%/archives/common/lzo/small_archive.lzo %%DATADIR%%/archives/common/rar/small_archive.rar %%DATADIR%%/archives/common/tar/small_archive.tar %%DATADIR%%/archives/common/xz/small_archive.xz %%DATADIR%%/archives/common/zip/small_archive.zip %%DATADIR%%/archives/exotic/arj/small_archive.arj %%DATADIR%%/archives/exotic/lha/small_archive.lha %%DATADIR%%/archives/exotic/lrzip/small_archive.lrz %%DATADIR%%/archives/exotic/lzip/small_archive.lz %%DATADIR%%/archives/exotic/lzma/small_archive.lzma %%DATADIR%%/archives/exotic/rzip/small_archive.rz %%DATADIR%%/archives/exotic/zoo/small_archive.zoo %%DATADIR%%/gif.dict %%DATADIR%%/html_tags.dict %%DATADIR%%/images/bmp/not_kitty.bmp %%DATADIR%%/images/gif/not_kitty.gif %%DATADIR%%/images/ico/not_kitty.ico %%DATADIR%%/images/jp2/not_kitty.jp2 %%DATADIR%%/images/jpeg/not_kitty.jpg %%DATADIR%%/images/jxr/not_kitty.jxr %%DATADIR%%/images/png/not_kitty.png %%DATADIR%%/images/png/not_kitty_alpha.png %%DATADIR%%/images/png/not_kitty_gamma.png %%DATADIR%%/images/png/not_kitty_icc.png %%DATADIR%%/images/tiff/not_kitty.tiff %%DATADIR%%/images/webp/not_kitty.webp %%DATADIR%%/jpeg.dict %%DATADIR%%/js.dict %%DATADIR%%/json.dict %%DATADIR%%/multimedia/h264/small_movie.mp4 %%DATADIR%%/others/elf/small_exec.elf %%DATADIR%%/others/js/small_script.js %%DATADIR%%/others/pcap/small_capture.pcap %%DATADIR%%/others/pdf/small.pdf %%DATADIR%%/others/rtf/small_document.rtf %%DATADIR%%/others/sql/simple_queries.sql %%DATADIR%%/others/text/hello_world.txt %%DATADIR%%/others/xml/small_document.xml %%DATADIR%%/pdf.dict %%DATADIR%%/png.dict +%%DATADIR%%/regexp.dict %%DATADIR%%/sql.dict %%DATADIR%%/tiff.dict %%DATADIR%%/webp.dict %%DATADIR%%/xml.dict %%PORTDOCS%%%%DOCSDIR%%/ChangeLog %%PORTDOCS%%%%DOCSDIR%%/QuickStartGuide.txt %%PORTDOCS%%%%DOCSDIR%%/README.md %%PORTDOCS%%%%DOCSDIR%%/binaryonly_fuzzing.txt %%PORTDOCS%%%%DOCSDIR%%/custom_mutator.txt %%PORTDOCS%%%%DOCSDIR%%/env_variables.txt %%GCC%%%%PORTDOCS%%%%DOCSDIR%%/gcc_plugin/README.gcc.md %%GCC%%%%PORTDOCS%%%%DOCSDIR%%/gcc_plugin/README.whitelist.md %%PORTDOCS%%%%DOCSDIR%%/historical_notes.txt -%%PORTDOCS%%%%DOCSDIR%%/libdislocator/README.md +%%PORTDOCS%%%%DOCSDIR%%/libdislocator/README.dislocator.md +%%PORTDOCS%%%%DOCSDIR%%/libtokencap/README.tokencap.md %%PORTDOCS%%%%DOCSDIR%%/life_pro_tips.txt %%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.md %%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.instrim.md %%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.laf-intel.md %%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.neverzero.md %%LLVM%%%%PORTDOCS%%%%DOCSDIR%%/llvm_mode/README.whitelist.md %%PORTDOCS%%%%DOCSDIR%%/notes_for_asan.txt %%PORTDOCS%%%%DOCSDIR%%/parallel_fuzzing.txt %%PORTDOCS%%%%DOCSDIR%%/perf_tips.txt %%PORTDOCS%%%%DOCSDIR%%/power_schedules.txt %%PORTDOCS%%%%DOCSDIR%%/python_mutators.txt %%PORTDOCS%%%%DOCSDIR%%/sister_projects.txt %%PORTDOCS%%%%DOCSDIR%%/status_screen.txt %%PORTDOCS%%%%DOCSDIR%%/technical_details.txt +%%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