summary refs log tree commit diff
path: root/pkgs/tools/security/afl
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2017-11-16 17:11:10 +0000
committerOrivej Desh <orivej@gmx.fr>2017-11-16 17:11:10 +0000
commit15ba4a5cfd13966a54e0b66dafd2f39f3e95ba34 (patch)
treeded42942399a7468a3379af5830753efe4469333 /pkgs/tools/security/afl
parenta5df25ce101c8839453d71be3d6b22ef7c446a2b (diff)
downloadnixpkgs-15ba4a5cfd13966a54e0b66dafd2f39f3e95ba34.tar
nixpkgs-15ba4a5cfd13966a54e0b66dafd2f39f3e95ba34.tar.gz
nixpkgs-15ba4a5cfd13966a54e0b66dafd2f39f3e95ba34.tar.bz2
nixpkgs-15ba4a5cfd13966a54e0b66dafd2f39f3e95ba34.tar.lz
nixpkgs-15ba4a5cfd13966a54e0b66dafd2f39f3e95ba34.tar.xz
nixpkgs-15ba4a5cfd13966a54e0b66dafd2f39f3e95ba34.tar.zst
nixpkgs-15ba4a5cfd13966a54e0b66dafd2f39f3e95ba34.zip
afl: 2.51b -> 2.52b
Fix build with glibc 2.26.

Tracking issue: #31696
Diffstat (limited to 'pkgs/tools/security/afl')
-rw-r--r--pkgs/tools/security/afl/default.nix8
-rw-r--r--pkgs/tools/security/afl/qemu-patches/qemu-2.3.0-glibc-2.26.patch121
-rw-r--r--pkgs/tools/security/afl/qemu.nix1
3 files changed, 128 insertions, 2 deletions
diff --git a/pkgs/tools/security/afl/default.nix b/pkgs/tools/security/afl/default.nix
index ae80b5ec0b5..51701590b8e 100644
--- a/pkgs/tools/security/afl/default.nix
+++ b/pkgs/tools/security/afl/default.nix
@@ -11,11 +11,11 @@ in
 
 stdenv.mkDerivation rec {
   name    = "afl-${version}";
-  version = "2.51b";
+  version = "2.52b";
 
   src = fetchurl {
     url    = "http://lcamtuf.coredump.cx/afl/releases/${name}.tgz";
-    sha256 = "15xvjma2lpawg1wasnja9wmgrpss5mnm3f5xmh5yli5q6m5vjdfl";
+    sha256 = "0ig0ij4n1pwry5dw1hk4q88801jzzy2cric6y2gd6560j55lnqa3";
   };
 
   # Note: libcgroup isn't needed for building, just for the afl-cgroup
@@ -58,6 +58,10 @@ stdenv.mkDerivation rec {
     done
   '';
 
+  passthru = {
+    qemu = afl-qemu;
+  };
+
   meta = {
     description = "Powerful fuzzer via genetic algorithms and instrumentation";
     longDescription = ''
diff --git a/pkgs/tools/security/afl/qemu-patches/qemu-2.3.0-glibc-2.26.patch b/pkgs/tools/security/afl/qemu-patches/qemu-2.3.0-glibc-2.26.patch
new file mode 100644
index 00000000000..1c447c4051e
--- /dev/null
+++ b/pkgs/tools/security/afl/qemu-patches/qemu-2.3.0-glibc-2.26.patch
@@ -0,0 +1,121 @@
+diff --git a/user-exec.c b/user-exec.c
+index 8f57e8a..957f9f7 100644
+--- a/user-exec.c
++++ b/user-exec.c
+@@ -57,7 +57,7 @@ static void exception_action(CPUState *cpu)
+ void cpu_resume_from_signal(CPUState *cpu, void *puc)
+ {
+ #ifdef __linux__
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+ #elif defined(__OpenBSD__)
+     struct sigcontext *uc = puc;
+ #endif
+@@ -171,7 +171,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #elif defined(__OpenBSD__)
+     struct sigcontext *uc = puc;
+ #else
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+ #endif
+     unsigned long pc;
+     int trapno;
+@@ -226,7 +226,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #elif defined(__OpenBSD__)
+     struct sigcontext *uc = puc;
+ #else
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+ #endif
+ 
+     pc = PC_sig(uc);
+@@ -288,7 +288,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ 
+ #ifdef __APPLE__
+ #include <sys/ucontext.h>
+-typedef struct ucontext SIGCONTEXT;
++typedef ucontext_t SIGCONTEXT;
+ /* All Registers access - only for local access */
+ #define REG_sig(reg_name, context)              \
+     ((context)->uc_mcontext->ss.reg_name)
+@@ -331,7 +331,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+     ucontext_t *uc = puc;
+ #else
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+ #endif
+     unsigned long pc;
+     int is_write;
+@@ -358,7 +358,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+                            void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     uint32_t *pc = uc->uc_mcontext.sc_pc;
+     uint32_t insn = *pc;
+     int is_write = 0;
+@@ -456,7 +456,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #if defined(__NetBSD__)
+     ucontext_t *uc = puc;
+ #else
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+ #endif
+     unsigned long pc;
+     int is_write;
+@@ -483,7 +483,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     uintptr_t pc = uc->uc_mcontext.pc;
+     uint32_t insn = *(uint32_t *)pc;
+     bool is_write;
+@@ -512,7 +512,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+                        void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     unsigned long pc;
+     int is_write;
+ 
+@@ -534,7 +534,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     unsigned long ip;
+     int is_write = 0;
+ 
+@@ -565,7 +565,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+                        void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     unsigned long pc;
+     uint16_t *pinsn;
+     int is_write = 0;
+@@ -618,7 +618,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+                        void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     greg_t pc = uc->uc_mcontext.pc;
+     int is_write;
+ 
+@@ -634,7 +634,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+                        void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     unsigned long pc = uc->uc_mcontext.sc_iaoq[0];
+     uint32_t insn = *(uint32_t *)pc;
+     int is_write = 0;
diff --git a/pkgs/tools/security/afl/qemu.nix b/pkgs/tools/security/afl/qemu.nix
index 0e91e287123..d21500960fe 100644
--- a/pkgs/tools/security/afl/qemu.nix
+++ b/pkgs/tools/security/afl/qemu.nix
@@ -43,6 +43,7 @@ stdenv.mkDerivation rec {
       ./qemu-patches/no-etc-install.patch
       ./qemu-patches/translate-all.patch
       ./qemu-patches/syscall.patch
+      ./qemu-patches/qemu-2.3.0-glibc-2.26.patch
     ];
 
   preConfigure = ''