Index: head/security/afl/Makefile =================================================================== --- head/security/afl/Makefile (revision 418274) +++ head/security/afl/Makefile (revision 418275) @@ -1,85 +1,85 @@ # Created by: Fabian Keil # $FreeBSD$ PORTNAME= afl -PORTVERSION= 2.07b +PORTVERSION= 2.19 +DISTVERSIONSUFFIX= b CATEGORIES= security MASTER_SITES= http://lcamtuf.coredump.cx/afl/releases/ MAINTAINER= t@tobik.me COMMENT= Fast instrumented fuzzer LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/docs/COPYING USES= compiler gmake tar:tgz OPTIONS_DEFINE= DEBUG DOCS MINIMIZE_CORPUS LLVM TEST_INSTRUMENTATION MINIMIZE_CORPUS_DESC= Install afl-cmin. Adds bash dependency TEST_INSTRUMENTATION_DESC= Execute tests (expected to fail in jails) LLVM_DESC= LLVM-based instrumentation (broken on 9.x) OPTIONS_DEFAULT= LLVM MINIMIZE_CORPUS OPTIONS_SUB= yes ONLY_FOR_ARCHS= amd64 i386 ONLY_FOR_ARCHS_REASON= Uses binary instrumentation LLVM_BUILD_DEPENDS= clang37:devel/llvm37 LLVM_RUN_DEPENDS= clang37:devel/llvm37 MINIMIZE_CORPUS_RUN_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash .include .if ${OSVERSION} < 1000013 # Broken on FreeBSD 9 PLIST_SUB+= LLVM_SUB="@comment " .else PLIST_SUB+= LLVM_SUB="" .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 MAKE_ARGS= INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ INSTALL_SCRIPT="${INSTALL_SCRIPT}" post-patch-TEST_INSTRUMENTATION-off: # afl needs shmget() which usually isn't available in jails. Disabling # the instrumentation tests makes sure building packages in jails works # by default anyway. ${REINPLACE_CMD} -e 's@^\(all.*\) test_build@\1@' ${WRKSRC}/Makefile ${REINPLACE_CMD} -e 's@^\(all.*\) test_build@\1@' ${WRKSRC}/llvm_mode/Makefile post-patch: .if ${ARCH} == "i386" ${REINPLACE_CMD} -e 's@\( as_params\[0\] = afl_as ? afl_as : \)\(.*\)@\1(u8*)"${LOCALBASE}/bin/as";@' \ ${WRKSRC}/afl-as.c .endif .if ! ${OSVERSION} < 1000013 # Broken on FreeBSD 9 post-build-LLVM-on: @(cd ${WRKSRC}/llvm_mode; ${SETENV} \ CC=clang37 \ CXX=clang++37 \ LLVM_CONFIG=llvm-config37 \ CFLAGS="${CFLAGS}" \ CXXFLAGS="${CXXFLAGS}" \ ${GMAKE}) .endif post-install: ${INSTALL_DATA} ${WRKSRC}/docs/COPYING ${STAGEDIR}${DOCSDIR}/ - .for afl_script in afl-cmin afl-plot afl-whatsup ${INSTALL_SCRIPT} ${WRKSRC}/${afl_script} ${STAGEDIR}${PREFIX}/bin/ .endfor post-install-MINIMIZE_CORPUS-on: ${INSTALL_SCRIPT} ${WRKSRC}/afl-cmin ${STAGEDIR}${PREFIX}/bin/ .include Index: head/security/afl/distinfo =================================================================== --- head/security/afl/distinfo (revision 418274) +++ head/security/afl/distinfo (revision 418275) @@ -1,2 +1,3 @@ -SHA256 (afl-2.07b.tgz) = 9dd324bc3930ec1dbb44d00df8dcf8a3c8ca54b765665cc7f20b89e71d70b184 -SIZE (afl-2.07b.tgz) = 814913 +TIMESTAMP = 1467977424 +SHA256 (afl-2.19b.tgz) = be12df9920c9cf68c412fb06ef5c7153f4b17e450b0195535a69663e749d8af2 +SIZE (afl-2.19b.tgz) = 817294 Index: head/security/afl/files/patch-Makefile =================================================================== --- head/security/afl/files/patch-Makefile (revision 418274) +++ head/security/afl/files/patch-Makefile (revision 418275) @@ -1,29 +1,31 @@ ---- Makefile.orig 2016-02-16 07:14:22 UTC +--- Makefile.orig 2016-06-24 02:35:35 UTC +++ Makefile @@ -21,6 +21,8 @@ BIN_PATH = $(PREFIX)/bin HELPER_PATH = $(PREFIX)/lib/afl DOC_PATH = $(PREFIX)/share/doc/afl MISC_PATH = $(PREFIX)/share/afl +INSTALL_PROGRAM?= install -s -m755 -+INSTALL_SCRIPT?= isntall -m755 ++INSTALL_SCRIPT?= install -m755 - PROGS = afl-gcc afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze - SH_PROGS = afl-plot afl-cmin afl-whatsup -@@ -115,12 +117,13 @@ clean: + # PROGS intentionally omit afl-as, which gets installed to its own dir. + +@@ -118,14 +120,15 @@ clean: install: all mkdir -p -m 755 $${DESTDIR}$(BIN_PATH) $${DESTDIR}$(HELPER_PATH) $${DESTDIR}$(DOC_PATH) $${DESTDIR}$(MISC_PATH) rm -f $${DESTDIR}$(BIN_PATH)/afl-plot.sh - install -m 755 $(PROGS) $(SH_PROGS) $${DESTDIR}$(BIN_PATH) + ${INSTALL_PROGRAM} $(PROGS) $${DESTDIR}$(BIN_PATH) + ${INSTALL_SCRIPT} $(SH_PROGS) $${DESTDIR}$(BIN_PATH) rm -f $${DESTDIR}$(BIN_PATH)/afl-as - if [ -f afl-qemu-trace ]; then install -m 755 afl-qemu-trace $${DESTDIR}$(BIN_PATH); fi - if [ -f afl-clang-fast -a -f afl-llvm-pass.so -a -f afl-llvm-rt.o ]; then set -e; install -m 755 afl-clang-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang-fast++; install -m 755 afl-llvm-pass.so afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH); fi + if [ -f afl-qemu-trace ]; then ${INSTALL_PROGRAM} afl-qemu-trace $${DESTDIR}$(BIN_PATH); fi -+ if [ -f afl-clang-fast -a -f afl-llvm-pass.so -a -f afl-llvm-rt.o ]; then set -e; ${INSTALL_PROGRAM} afl-clang-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang-fast++; ${INSTALL_PROGRAM} afl-llvm-pass.so $${DESTDIR}$(HELPER_PATH); install -m 755 afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH); fi ++ if [ -f afl-clang-fast -a -f afl-llvm-pass.so -a -f afl-llvm-rt.o ]; then set -e; ${INSTALL_PROGRAM} afl-clang-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang-fast++; ${INSTALL_PROGRAM} afl-llvm-pass.so afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH); fi + if [ -f afl-llvm-rt-32.o ]; then set -e; install -m 755 afl-llvm-rt-32.o $${DESTDIR}$(HELPER_PATH); fi + if [ -f afl-llvm-rt-64.o ]; then set -e; install -m 755 afl-llvm-rt-64.o $${DESTDIR}$(HELPER_PATH); fi set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $${DESTDIR}$(BIN_PATH)/$$i; done - install -m 755 afl-as $${DESTDIR}$(HELPER_PATH) + ${INSTALL_PROGRAM} afl-as $${DESTDIR}$(HELPER_PATH) ln -sf afl-as $${DESTDIR}$(HELPER_PATH)/as install -m 644 docs/README docs/ChangeLog docs/*.txt $${DESTDIR}$(DOC_PATH) cp -r testcases/ $${DESTDIR}$(MISC_PATH) Index: head/security/afl/files/patch-llvm__mode_afl-clang-fast.c =================================================================== --- head/security/afl/files/patch-llvm__mode_afl-clang-fast.c (revision 418274) +++ head/security/afl/files/patch-llvm__mode_afl-clang-fast.c (revision 418275) @@ -1,15 +1,15 @@ ---- llvm_mode/afl-clang-fast.c.orig 2015-09-08 22:37:25 UTC +--- llvm_mode/afl-clang-fast.c.orig 2016-06-07 18:07:43 UTC +++ llvm_mode/afl-clang-fast.c @@ -106,10 +106,10 @@ static void edit_params(u32 argc, char** if (!strcmp(name, "afl-clang-fast++")) { u8* alt_cxx = getenv("AFL_CXX"); - cc_params[0] = alt_cxx ? alt_cxx : (u8*)"clang++"; + cc_params[0] = alt_cxx ? alt_cxx : (u8*)"clang++37"; } else { u8* alt_cc = getenv("AFL_CC"); - cc_params[0] = alt_cc ? alt_cc : (u8*)"clang"; + cc_params[0] = alt_cc ? alt_cc : (u8*)"clang37"; } - cc_params[cc_par_cnt++] = "-Xclang"; + /* There are two ways to compile afl-clang-fast. In the traditional mode, we Index: head/security/afl/pkg-plist =================================================================== --- head/security/afl/pkg-plist (revision 418274) +++ head/security/afl/pkg-plist (revision 418275) @@ -1,80 +1,82 @@ bin/afl-analyze bin/afl-clang bin/afl-clang++ %%LLVM_SUB%%%%LLVM%%bin/afl-clang-fast %%LLVM_SUB%%%%LLVM%%bin/afl-clang-fast++ %%LLVM_SUB%%%%LLVM%%lib/afl/afl-llvm-pass.so %%LLVM_SUB%%%%LLVM%%lib/afl/afl-llvm-rt.o +%%LLVM_SUB%%%%LLVM%%lib/afl/afl-llvm-rt-32.o +%%LLVM_SUB%%%%LLVM%%lib/afl/afl-llvm-rt-64.o %%MINIMIZE_CORPUS%%bin/afl-cmin bin/afl-fuzz bin/afl-g++ bin/afl-gcc bin/afl-gotcpu bin/afl-plot bin/afl-showmap bin/afl-tmin bin/afl-whatsup lib/afl/afl-as lib/afl/as %%DATADIR%%/README.testcases %%DATADIR%%/_extras/gif.dict %%DATADIR%%/_extras/html_tags.dict %%DATADIR%%/_extras/jpeg.dict %%DATADIR%%/_extras/js.dict %%DATADIR%%/_extras/pdf.dict %%DATADIR%%/_extras/png.dict %%DATADIR%%/_extras/sql.dict %%DATADIR%%/_extras/tiff.dict %%DATADIR%%/_extras/webp.dict %%DATADIR%%/_extras/xml.dict %%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%%/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%%/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 %%PORTDOCS%%%%DOCSDIR%%/COPYING %%PORTDOCS%%%%DOCSDIR%%/ChangeLog %%PORTDOCS%%%%DOCSDIR%%/README %%PORTDOCS%%%%DOCSDIR%%/env_variables.txt %%PORTDOCS%%%%DOCSDIR%%/historical_notes.txt %%PORTDOCS%%%%DOCSDIR%%/notes_for_asan.txt %%PORTDOCS%%%%DOCSDIR%%/parallel_fuzzing.txt %%PORTDOCS%%%%DOCSDIR%%/perf_tips.txt %%PORTDOCS%%%%DOCSDIR%%/sister_projects.txt %%PORTDOCS%%%%DOCSDIR%%/status_screen.txt %%PORTDOCS%%%%DOCSDIR%%/technical_details.txt %%PORTDOCS%%%%DOCSDIR%%/QuickStartGuide.txt