diff options
author | Robert Scott <code@humanleg.org.uk> | 2019-12-21 13:50:23 +0000 |
---|---|---|
committer | Austin Seipp <aseipp@pobox.com> | 2019-12-30 10:21:19 -0600 |
commit | de0e71780cfea4976d934af53ebc124819146469 (patch) | |
tree | ceda79614271126516c0fad1cc0423414f3365a5 /pkgs/tools/security/afl | |
parent | 21958c0603e4f4cae9655f49429330b11a8cc8d1 (diff) |
afl: 2.52b -> 2.56b
can remove qemu glibc patch as it is now covered by afl's own patches
Diffstat (limited to 'pkgs/tools/security/afl')
-rw-r--r-- | pkgs/tools/security/afl/README.md | 4 | ||||
-rw-r--r-- | pkgs/tools/security/afl/default.nix | 12 | ||||
-rw-r--r-- | pkgs/tools/security/afl/libdislocator.nix | 2 | ||||
-rw-r--r-- | pkgs/tools/security/afl/qemu-patches/qemu-2.10.0-glibc-2.27.patch | 28 | ||||
-rw-r--r-- | pkgs/tools/security/afl/qemu.nix | 18 |
5 files changed, 19 insertions, 45 deletions
diff --git a/pkgs/tools/security/afl/README.md b/pkgs/tools/security/afl/README.md index 0b0d4e80fbca9..180cad6bc4ca6 100644 --- a/pkgs/tools/security/afl/README.md +++ b/pkgs/tools/security/afl/README.md @@ -4,12 +4,12 @@ Updating the QEMU patches When updating to the latest American Fuzzy Lop, make sure to check for any new patches to qemu for binary fuzzing support: -https://github.com/mirrorer/afl/tree/master/qemu_mode +https://github.com/google/AFL/tree/master/qemu_mode Be sure to check the build script and make sure it's also using the right QEMU version and options in `qemu.nix`: -https://github.com/mirrorer/afl/blob/master/qemu_mode/build_qemu_support.sh +https://github.com/google/AFL/blob/master/qemu_mode/build_qemu_support.sh `afl-config.h`, `afl-types.h`, and `afl-qemu-cpu-inl.h` are part of the afl source code, and copied from `config.h`, `types.h` and diff --git a/pkgs/tools/security/afl/default.nix b/pkgs/tools/security/afl/default.nix index 05866792af68b..df5e3728943ec 100644 --- a/pkgs/tools/security/afl/default.nix +++ b/pkgs/tools/security/afl/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, callPackage, makeWrapper +{ stdenv, fetchFromGitHub, callPackage, makeWrapper , clang, llvm, which, libcgroup }: @@ -9,11 +9,13 @@ let else throw "afl: no support for ${stdenv.hostPlatform.system}!"; afl = stdenv.mkDerivation rec { pname = "afl"; - version = "2.52b"; + version = "2.56b"; - src = fetchurl { - url = "http://lcamtuf.coredump.cx/afl/releases/${pname}-${version}.tgz"; - sha256 = "0ig0ij4n1pwry5dw1hk4q88801jzzy2cric6y2gd6560j55lnqa3"; + src = fetchFromGitHub { + owner = "google"; + repo = pname; + rev = "v${version}"; + sha256 = "1q1g59gkm48aa4cg9h70jx4i2gapmypgp5rzs156b2avd95vwkn1"; }; enableParallelBuilding = true; diff --git a/pkgs/tools/security/afl/libdislocator.nix b/pkgs/tools/security/afl/libdislocator.nix index 415fa82f2ec65..953c59e435cb0 100644 --- a/pkgs/tools/security/afl/libdislocator.nix +++ b/pkgs/tools/security/afl/libdislocator.nix @@ -5,7 +5,7 @@ stdenv.mkDerivation { pname = "libdislocator"; src = afl.src; - sourceRoot = "${afl.name}/libdislocator"; + sourceRoot = "${afl.src.name}/libdislocator"; makeFlags = [ "PREFIX=$(out)" ]; diff --git a/pkgs/tools/security/afl/qemu-patches/qemu-2.10.0-glibc-2.27.patch b/pkgs/tools/security/afl/qemu-patches/qemu-2.10.0-glibc-2.27.patch deleted file mode 100644 index 6cc663dc1fb93..0000000000000 --- a/pkgs/tools/security/afl/qemu-patches/qemu-2.10.0-glibc-2.27.patch +++ /dev/null @@ -1,28 +0,0 @@ -A modified version of qemu commit 75e5b70e6b5dcc4f2219992d7cffa462aa406af0 -diff --git a/configure b/configure -index 9c8aa5a..99ccc17 100755 ---- a/configure -+++ b/configure -@@ -3855,7 +3855,7 @@ fi - # check if memfd is supported - memfd=no - cat > $TMPC << EOF --#include <sys/memfd.h> -+#include <sys/mman.h> - - int main(void) - { -diff --git a/util/memfd.c b/util/memfd.c -index 4571d1a..412e94a 100644 ---- a/util/memfd.c -+++ b/util/memfd.c -@@ -31,9 +31,7 @@ - - #include "qemu/memfd.h" - --#ifdef CONFIG_MEMFD --#include <sys/memfd.h> --#elif defined CONFIG_LINUX -+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD - #include <sys/syscall.h> - #include <asm/unistd.h> diff --git a/pkgs/tools/security/afl/qemu.nix b/pkgs/tools/security/afl/qemu.nix index d80d301351f43..479de4b418501 100644 --- a/pkgs/tools/security/afl/qemu.nix +++ b/pkgs/tools/security/afl/qemu.nix @@ -6,7 +6,6 @@ with stdenv.lib; let qemuName = "qemu-2.10.0"; - aflName = afl.name; cpuTarget = if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux-user" else if stdenv.hostPlatform.system == "i686-linux" then "i386-linux-user" else throw "afl: no support for ${stdenv.hostPlatform.system}!"; @@ -25,12 +24,12 @@ stdenv.mkDerivation { sourceRoot = qemuName; postUnpack = '' - cp ${aflName}/types.h $sourceRoot/afl-types.h - substitute ${aflName}/config.h $sourceRoot/afl-config.h \ + cp ${afl.src.name}/types.h $sourceRoot/afl-types.h + substitute ${afl.src.name}/config.h $sourceRoot/afl-config.h \ --replace "types.h" "afl-types.h" - substitute ${aflName}/qemu_mode/patches/afl-qemu-cpu-inl.h $sourceRoot/afl-qemu-cpu-inl.h \ + substitute ${afl.src.name}/qemu_mode/patches/afl-qemu-cpu-inl.h $sourceRoot/afl-qemu-cpu-inl.h \ --replace "../../config.h" "afl-config.h" - substituteInPlace ${aflName}/qemu_mode/patches/cpu-exec.diff \ + substituteInPlace ${afl.src.name}/qemu_mode/patches/cpu-exec.diff \ --replace "../patches/afl-qemu-cpu-inl.h" "afl-qemu-cpu-inl.h" ''; @@ -46,12 +45,13 @@ stdenv.mkDerivation { patches = [ # patches extracted from afl source - "../${aflName}/qemu_mode/patches/cpu-exec.diff" - "../${aflName}/qemu_mode/patches/elfload.diff" - "../${aflName}/qemu_mode/patches/syscall.diff" + "../${afl.src.name}/qemu_mode/patches/cpu-exec.diff" + "../${afl.src.name}/qemu_mode/patches/elfload.diff" + "../${afl.src.name}/qemu_mode/patches/syscall.diff" + "../${afl.src.name}/qemu_mode/patches/configure.diff" + "../${afl.src.name}/qemu_mode/patches/memfd.diff" # nix-specific patches to make installation more well-behaved ./qemu-patches/no-etc-install.patch - ./qemu-patches/qemu-2.10.0-glibc-2.27.patch ]; configureFlags = |