summary refs log tree commit diff
path: root/pkgs/tools/security/afl
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2019-12-21 13:50:23 +0000
committerAustin Seipp <aseipp@pobox.com>2019-12-30 10:21:19 -0600
commitde0e71780cfea4976d934af53ebc124819146469 (patch)
treeceda79614271126516c0fad1cc0423414f3365a5 /pkgs/tools/security/afl
parent21958c0603e4f4cae9655f49429330b11a8cc8d1 (diff)
downloadnixpkgs-de0e71780cfea4976d934af53ebc124819146469.tar
nixpkgs-de0e71780cfea4976d934af53ebc124819146469.tar.gz
nixpkgs-de0e71780cfea4976d934af53ebc124819146469.tar.bz2
nixpkgs-de0e71780cfea4976d934af53ebc124819146469.tar.lz
nixpkgs-de0e71780cfea4976d934af53ebc124819146469.tar.xz
nixpkgs-de0e71780cfea4976d934af53ebc124819146469.tar.zst
nixpkgs-de0e71780cfea4976d934af53ebc124819146469.zip
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.md4
-rw-r--r--pkgs/tools/security/afl/default.nix12
-rw-r--r--pkgs/tools/security/afl/libdislocator.nix2
-rw-r--r--pkgs/tools/security/afl/qemu-patches/qemu-2.10.0-glibc-2.27.patch28
-rw-r--r--pkgs/tools/security/afl/qemu.nix18
5 files changed, 19 insertions, 45 deletions
diff --git a/pkgs/tools/security/afl/README.md b/pkgs/tools/security/afl/README.md
index 0b0d4e80fbc..180cad6bc4c 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 05866792af6..df5e3728943 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 415fa82f2ec..953c59e435c 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 6cc663dc1fb..00000000000
--- 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 d80d301351f..479de4b4185 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 =