[PATCH 0/2] Add aflplusplus

  • Done
  • quality assurance status badge
Details
2 participants
  • Denis 'GNUtoo' Carikli
  • Hilton Chain
Owner
unassigned
Submitted by
Denis 'GNUtoo' Carikli
Severity
normal
D
D
Denis 'GNUtoo' Carikli wrote on 4 Apr 2023 19:44
(address . guix-patches@gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
20230404174449.5297-1-GNUtoo@cyberdimension.org
Hi,

Here's two patches to add aflplusplus. I've also patches (not part of this
serie) to add support for faster compilers with GCC plugins, but when I do
that it somehow fails to run:
$ cat main.c
int main()
{
printf("Hello world\n");
}
$ afl-gcc-fast ./main.c
afl-cc++4.05c by Michal Zalewski, Laszlo Szekeres, Marc Heuse - mode: GCC_PLUGIN-DEFAULT
cc1: error: cannot load plugin /gnu/store/sx55p7b4r21kiw7sagi8cb8ff6zmvmqd-aflplusplus-4.05c/bin/../lib/afl//afl-gcc-pass.so: /gnu/store/sx55p7b4r21kiw7sagi8cb8ff6zmvmqd-aflplusplus-4.05c/bin/../lib/afl//afl-gcc-pass.so: undefined symbol: _Z30gimple_build_call_internal_vec11internal_fn3vecIP9tree_node7va_heap6vl_ptrE

So I limited that serie to what works well.


Denis 'GNUtoo' Carikli (2):
gnu: Add aflplusplus.
gnu: aflplusplus: Add python support

gnu/packages/debug.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)


base-commit: b9c9c23939a40a850a8c78579adaec25d1972bd1
--
2.39.1
D
D
Denis 'GNUtoo' Carikli wrote on 5 Apr 2023 03:29
[PATCH 1/2] gnu: Add aflplusplus.
(address . 62666@debbugs.gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
20230405012914.16778-1-GNUtoo@cyberdimension.org
* gnu/packages/debug.scm (aflplusplus): New variable.
---
gnu/packages/debug.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 154232ed50..88b8cb8b8b 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -460,6 +460,37 @@ (define-public qemu-for-american-fuzzy-lop
;; Several tests fail on MIPS.
(supported-systems (delete "mips64el-linux" %supported-systems))))))
+(define-public aflplusplus
+ (package
+ (inherit american-fuzzy-lop)
+ (name "aflplusplus")
+ (version "4.05c")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/AFLplusplus/AFLplusplus")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0cl0bgvd2yy331zchjz5drcnadam6w0vfmwcq1jf285hw0x8b0bk"))))
+ (inputs (list qemu))
+ (home-page "https://aflplus.plus")
+ (description
+ "AFLplusplus is a security-oriented fuzzer that employs a novel type of
+compile-time instrumentation and genetic algorithms to automatically discover
+clean, interesting test cases that trigger new internal states in the targeted
+binary. This substantially improves the functional coverage for the fuzzed
+code. The compact synthesized corpora produced by the tool are also useful
+for seeding other, more labor- or resource-intensive testing regimes down the
+road. It is a fork of American Fuzzy Lop fuzzer and compared to it:
+@itemize
+@item It Supports a more recent qemu version
+@item It supports more algorithms like collision-free coverage, enhanced
+laf-intel & redqueen, AFLfast++ power schedules, MOpt mutators, unicorn_mode,
+etc.
+@end itemize")))
+
(define-public stress-make
(let ((commit "97815bed8060de33952475b3498767c91f59ffd9")
(revision "2")) ;No official source distribution
--
2.39.1
D
D
Denis 'GNUtoo' Carikli wrote on 5 Apr 2023 03:29
[PATCH 2/2] gnu: aflplusplus: Add python support
(address . 62666@debbugs.gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
20230405012914.16778-2-GNUtoo@cyberdimension.org
* gnu/packages/debug.scm (aflplusplus): [inputs]: Add python.
---
gnu/packages/debug.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 88b8cb8b8b..21df553ef6 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -474,7 +474,7 @@ (define-public aflplusplus
(sha256
(base32
"0cl0bgvd2yy331zchjz5drcnadam6w0vfmwcq1jf285hw0x8b0bk"))))
- (inputs (list qemu))
+ (inputs (list python qemu))
(home-page "https://aflplus.plus")
(description
"AFLplusplus is a security-oriented fuzzer that employs a novel type of
--
2.39.1
H
H
Hilton Chain wrote on 23 Aug 2023 04:34
Re: [bug#62666] [PATCH 0/2] Add aflplusplus
(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)(address . 62666@debbugs.gnu.org)
87a5ui4hbr.wl-hako@ultrarare.space
Hi Denis,

On Wed, 05 Apr 2023 01:44:49 +0800,
Denis 'GNUtoo' Carikli wrote:
Toggle quote (30 lines)
>
> Hi,
>
> Here's two patches to add aflplusplus. I've also patches (not part of this
> serie) to add support for faster compilers with GCC plugins, but when I do
> that it somehow fails to run:
> $ cat main.c
> int main()
> {
> printf("Hello world\n");
> }
> $ afl-gcc-fast ./main.c
> afl-cc++4.05c by Michal Zalewski, Laszlo Szekeres, Marc Heuse - mode: GCC_PLUGIN-DEFAULT
> cc1: error: cannot load plugin /gnu/store/sx55p7b4r21kiw7sagi8cb8ff6zmvmqd-aflplusplus-4.05c/bin/../lib/afl//afl-gcc-pass.so: /gnu/store/sx55p7b4r21kiw7sagi8cb8ff6zmvmqd-aflplusplus-4.05c/bin/../lib/afl//afl-gcc-pass.so: undefined symbol: _Z30gimple_build_call_internal_vec11internal_fn3vecIP9tree_node7va_heap6vl_ptrE
>
> So I limited that serie to what works well.
>
>
> Denis 'GNUtoo' Carikli (2):
> gnu: Add aflplusplus.
> gnu: aflplusplus: Add python support
>
> gnu/packages/debug.scm | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
>
> base-commit: b9c9c23939a40a850a8c78579adaec25d1972bd1
> --
> 2.39.1

I think (for the plugin) this is related:
Toggle snippet (14 lines)
[+] All set and ready to build.
g++ -O3 -g -funroll-loops -D_FORTIFY_SOURCE=1 -Wall -std=c++11 -fPIC -fno-rtti -I"/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin"/include -I"/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin" -shared instrumentation/afl-gcc-pass.so.cc -o afl-gcc-pass.so
In file included from /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin/include/gcc-plugin.h:28,
from instrumentation/afl-gcc-common.h:46,
from instrumentation/afl-gcc-pass.so.cc:127:
/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin/include/system.h:698:10: fatal error: gmp.h: No such file or directory
698 | #include <gmp.h>
| ^~~~~~~
compilation terminated.
make[1]: *** [GNUmakefile.gcc_plugin:149: afl-gcc-pass.so] Error 1
make[1]: Leaving directory '/tmp/guix-build-aflplusplus-4.05c.drv-0/source'
make: [GNUmakefile:790: install] Error 2 (ignored)

Can you address the issue and send an updated patch?

Thanks
D
D
Denis 'GNUtoo' Carikli wrote on 15 Sep 2023 05:25
(name . Hilton Chain)(address . hako@ultrarare.space)(address . 62666@debbugs.gnu.org)
20230915052540.7a3029ba@primary_laptop
On Wed, 23 Aug 2023 10:34:48 +0800
Hilton Chain <hako@ultrarare.space> wrote:
Toggle quote (24 lines)
> > Here's two patches to add aflplusplus. I've also patches (not part
> > of this serie) to add support for faster compilers with GCC
> > plugins, but when I do that it somehow fails to run:
> I think (for the plugin) this is related:
> --8<---------------cut here---------------start------------->8---
> [+] All set and ready to build.
> g++ -O3 -g -funroll-loops -D_FORTIFY_SOURCE=1 -Wall -std=c++11 -fPIC
> -fno-rtti
> -I"/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin"/include
> -I"/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin"
> -shared instrumentation/afl-gcc-pass.so.cc -o afl-gcc-pass.so In file
> included from
> /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin/include/gcc-plugin.h:28,
> from instrumentation/afl-gcc-common.h:46, from
> instrumentation/afl-gcc-pass.so.cc:127:
> /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin/include/system.h:698:10:
> fatal error: gmp.h: No such file or directory 698 | #include <gmp.h>
> | ^~~~~~~ compilation terminated. make[1]: ***
> [GNUmakefile.gcc_plugin:149: afl-gcc-pass.so] Error 1 make[1]:
> Leaving directory '/tmp/guix-build-aflplusplus-4.05c.drv-0/source'
> make: [GNUmakefile:790: install] Error 2 (ignored)
> --8<---------------cut here---------------end--------------->8---
>
> Can you address the issue and send an updated patch?
The issue turned out to be that it called "gcc" instead of the gcc
available during the build.

Qemu is one of the aflplusplus dependencies and it doesn't cross
compile:
Toggle quote (4 lines)
> $ guix build --target=aarch64-linux-gnu qemu
> guix build: error: gnu/packages/gnome.scm:3501:2: librsvg@2.54.5:
> build system `cargo' does not support cross builds

So for simplicity I've simply made aflplusplus use the gcc that is in
the inputs.

I've verified that it took the right gcc by adding '(invoke "gcc"
"--version")' to the package and verifying that it was really gcc-11.

I've also updated aflplusplus to the latest version along the way.

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmUDzrQACgkQX138wUF3
4mP5zg/9HaiFIXw8FNvVOdOSyrCb7EMHMkcahGse4DhsrN8jSk9bQmt+YRZG67hV
BOC3LxEt8vruliRbJgPWRdZZjrpPhCVAJSMexi9RCbkiY2rexVMDfR8+PEcMAn8a
IKTO+znwEb1UjxSaMoroNQxpumK2J/IU+Zv/uoNZit+uYRhZYX/tV4W4ykfvYGCi
LfvaFMFV90yxHSacnC+UB6Lt++n5oZctEltpuTMHmKtk5VSMevHT0tOM3Z+gdJ4T
331w0rIS2VM0HrPx8Wm0QX5JUVk6BY3UkpcXS6nsahxLpokLLxpyMf5vyi9cu59q
DRnGJC/7QSR/vJWwWWoWIasrug5lq5rG2DXBphzSLGcTWLNnsW/78mkG+YYECoba
7siHj5qOKHA3FU9aPYw6KzqNncm4RU00CfduX6L62vmATLPcUEkvUeL7x70jSs5d
/LlcLX3Sv79lCfetd9D4gaMk+BixcGrLNCXi/j8k00CEQDKDYK4KyhaBonfBCFH/
DGEJWmuqIE16qbIk0+oLCL453uHR8s+MucJg8tPq6h3HqrAqyhSikYY0jNbJOQ5d
RsbuTSc3uQnBV6iibR8tXOBiM/D6nvesNCKGR9IANPVWFCM3nnyui5Zj9i0N8esP
IprA6Dbqn8SOgCZ3Bplzp36Cqovpillph5u5NI8b5iKR+LPzleE=
=CAhj
-----END PGP SIGNATURE-----


D
D
Denis 'GNUtoo' Carikli wrote on 15 Sep 2023 05:27
[PATCH v2 1/3] gnu: Add aflplusplus.
(address . 62666@debbugs.gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
08dda007d354a5857a348d8d001c06216c940893.1694747779.git.GNUtoo@cyberdimension.org
* gnu/packages/debug.scm (aflplusplus): New variable.
---
ChangeLog:
- Updated to 4.08c
---
gnu/packages/debug.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index e2a29a3ae9..cd1eccbd7b 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -459,6 +459,37 @@ (define-public qemu-for-american-fuzzy-lop
;; Several tests fail on MIPS.
(supported-systems (delete "mips64el-linux" %supported-systems))))))
+(define-public aflplusplus
+ (package
+ (inherit american-fuzzy-lop)
+ (name "aflplusplus")
+ (version "4.08c")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/AFLplusplus/AFLplusplus")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "01hxj65if6rkjrj1fqcgq0jl95dirhkn00mi2k65mff6bckaamxg"))))
+ (inputs (list qemu))
+ (home-page "https://aflplus.plus")
+ (description
+ "AFLplusplus is a security-oriented fuzzer that employs a novel type of
+compile-time instrumentation and genetic algorithms to automatically discover
+clean, interesting test cases that trigger new internal states in the targeted
+binary. This substantially improves the functional coverage for the fuzzed
+code. The compact synthesized corpora produced by the tool are also useful
+for seeding other, more labor- or resource-intensive testing regimes down the
+road. It is a fork of American Fuzzy Lop fuzzer and compared to it:
+@itemize
+@item It Supports a more recent qemu version
+@item It supports more algorithms like collision-free coverage, enhanced
+laf-intel & redqueen, AFLfast++ power schedules, MOpt mutators, unicorn_mode,
+etc.
+@end itemize")))
+
(define-public stress-make
(let ((commit "97815bed8060de33952475b3498767c91f59ffd9")
(revision "2")) ;No official source distribution
--
2.41.0
D
D
Denis 'GNUtoo' Carikli wrote on 15 Sep 2023 05:27
[PATCH v2 2/3] gnu: aflplusplus: Add python support
(address . 62666@debbugs.gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
6382108e29da93b59e39e7df48351444397cb843.1694747779.git.GNUtoo@cyberdimension.org
* gnu/packages/debug.scm (aflplusplus): [inputs]: Add python.
---
ChangeLog: no changes
---
gnu/packages/debug.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index cd1eccbd7b..04458d0220 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -473,7 +473,7 @@ (define-public aflplusplus
(sha256
(base32
"01hxj65if6rkjrj1fqcgq0jl95dirhkn00mi2k65mff6bckaamxg"))))
- (inputs (list qemu))
+ (inputs (list python qemu))
(home-page "https://aflplus.plus")
(description
"AFLplusplus is a security-oriented fuzzer that employs a novel type of
--
2.41.0
D
D
Denis 'GNUtoo' Carikli wrote on 15 Sep 2023 05:27
[PATCH v2 3/3] gnu: aflplusplus: Build afl-gcc/g++-fast
(address . 62666@debbugs.gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
b52a0ec129defb832bc03e69a12259d6d3563676.1694747779.git.GNUtoo@cyberdimension.org
* gnu/packages/debug.scm (aflplusplus): [inputs]: Add gcc, gmp.
---
ChangeLog: New patch
---
gnu/packages/debug.scm | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)

Toggle diff (59 lines)
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 04458d0220..c9fdca8c8b 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -50,6 +50,7 @@ (define-module (gnu packages debug)
#:use-module (gnu packages code)
#:use-module (gnu packages compression)
#:use-module (gnu packages flex)
+ #:use-module (gnu packages gcc)
#:use-module (gnu packages gdb)
#:use-module (gnu packages glib)
#:use-module (gnu packages gtk)
@@ -59,6 +60,7 @@ (define-module (gnu packages debug)
#:use-module (gnu packages libusb)
#:use-module (gnu packages linux)
#:use-module (gnu packages llvm)
+ #:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages ninja)
#:use-module (gnu packages perl)
@@ -473,7 +475,35 @@ (define-public aflplusplus
(sha256
(base32
"01hxj65if6rkjrj1fqcgq0jl95dirhkn00mi2k65mff6bckaamxg"))))
- (inputs (list python qemu))
+ (arguments
+ (substitute-keyword-arguments (package-arguments american-fuzzy-lop)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ ;; TODO: Enable to cross compile aflplusplus by also enabling qemu
+ ;; to be cross compiled and by fixing the use-build-gcc phase below.
+ (add-before 'build 'use-build-gcc
+ (lambda _
+ ;; We need to patch it to select the build-time gcc else we get
+ ;; something like that:
+ ;; $ afl-gcc-fast main.c
+ ;; afl-cc++4.08c by [...] - mode: GCC_PLUGIN-DEFAULT
+ ;; cc1: error: cannot load plugin
+ ;; /gnu/[...]-aflplusplus-4.08c/bin/../lib/afl//afl-gcc-pass.so:
+ ;; /gnu/[...]-aflplusplus-4.08c/bin/../lib/afl//afl-gcc-pass.so:
+ ;; undefined symbol:
+ ;; _Z30gimple_build_call_internal_vec11internal_fn3vecIP9tree_node7va_heap6vl_ptrE
+ (substitute* "src/afl-cc.c"
+ (("alt_cc = \"gcc\";")
+ (string-append "alt_cc = \""
+ (which "gcc") "\";"))
+ (("alt_cxx = \"g\\+\\+\";")
+ (string-append "alt_cxx = \""
+ (which "g++") "\";")))))))))
+ ;; afl-gcc and g++-fast require gcc and gmp. The gcc-11 input is used
+ ;; instead of gcc because in the Dockerfile inside aflplusplus source code
+ ;; has the following comment: "GCC 12 is producing compile errors for some
+ ;; targets so we stay at GCC 11".
+ (inputs (list gcc-11 gmp python qemu))
(home-page "https://aflplus.plus")
(description
"AFLplusplus is a security-oriented fuzzer that employs a novel type of
--
2.41.0
D
D
Denis 'GNUtoo' Carikli wrote on 23 Nov 2023 17:56
(no subject)
(address . 62666@debbugs.gnu.org)
20231123175643.283ca7ce@primary_laptop
ping
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmVfhEsACgkQX138wUF3
4mPGig//YbF/NWU1NQZSxEVW2BrTGh6+mdPAbcz55zxzate0uzDUr30F3t4Ckiht
1eMHMnLhwG+3esvdO4sOkyZEB5t1CRpMy/US4/J3D+l6zcoYMVDWPmssMSRCOzQW
pINRhLhCL0H/0CF6oR9wtW2BWsbflklWeZD8EaWi3jCdzjdawu8jDITGFEwaRcEQ
YHw5q4jhsM1yZ/ULDmIpkYM72pC1wk2MtOirj/G2vhce9j3NYcR4T7vwcYxmeLdr
PtzLN6fJ0qMVSLxyh8qWHNyQKEe4fWQX4QZ13csbNKTzmLPXcCDpfBgOc/Y7J6sc
PLDcGMF+MrInlC4xWU+Y100sxKcgQcpJUvs52tQ2fJFTuCYpS8qVB0LEo0yS3Db3
F+U5eeKw5Av9IaGKlGv5AZQSwTxqp2294HNu2i3qcLvE6yJTToC2rmLWVAlL8xiJ
Rg5/9ff/ArODbWIr5VppR0vAzXvTomAMnR9qfaEIfctBNMp0+H0poORT4bkuWane
8ATG1xU8DS6uEkVkPMuTkOuJdgo+mNbMHyBj5RRLBhRSeRBgkpfpWGLyUI6u+aqs
FYJWnaQl/ysG1iriMfs4iWt7mOzbti0FIL31d5NYH8QIvbqgSBYnKZiwGVaI5E5w
YTtWyLYGqHhBQGz28oFI9IAPixVYWa5TcPPnFZ9SiHkHIzTsQVY=
=cuCZ
-----END PGP SIGNATURE-----


H
H
Hilton Chain wrote on 8 Jan 09:19 +0100
[PATCH v3] gnu: Add aflplusplus.
(address . 62666@debbugs.gnu.org)
c6acc69244a24083c12c2fdaec5dd2448fd07b63.1704701633.git.hako@ultrarare.space
From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>

* gnu/packages/debug.scm (aflplusplus): New variable.

Change-Id: Ibda36187e839d5f533d461444db25a7ba5567f0f
Modified-by: Hilton Chain <hako@ultrarare.space>
---

Hi Denis,

Aplogies for the long delay...

I have adjusted the phases for proper cross-compilation support and updated the
package to the latest version.

I'm sending out v3 mainly for QA purpose, I'll push it if there's no further
issue.

Thanks

gnu/packages/debug.scm | 55 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)

Toggle diff (82 lines)
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 5a528c7a28..6d4567acc4 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -50,6 +50,7 @@ (define-module (gnu packages debug)
#:use-module (gnu packages code)
#:use-module (gnu packages compression)
#:use-module (gnu packages flex)
+ #:use-module (gnu packages gcc)
#:use-module (gnu packages gdb)
#:use-module (gnu packages glib)
#:use-module (gnu packages gtk)
@@ -59,6 +60,7 @@ (define-module (gnu packages debug)
#:use-module (gnu packages libusb)
#:use-module (gnu packages linux)
#:use-module (gnu packages llvm)
+ #:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages ninja)
#:use-module (gnu packages perl)
@@ -459,6 +461,59 @@ (define-public qemu-for-american-fuzzy-lop
;; Several tests fail on MIPS.
(supported-systems (delete "mips64el-linux" %supported-systems))))))

+(define-public aflplusplus
+ (package
+ (inherit american-fuzzy-lop)
+ (name "aflplusplus")
+ (version "4.09c")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/AFLplusplus/AFLplusplus")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "12bplpd8cifla6m9l130fd22ggzkhd1w5s1aifw1idpy3njhj129"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments american-fuzzy-lop)
+ ((#:make-flags _ ''())
+ #~(list (string-append "PREFIX=" #$output)
+ (string-append "DOC_PATH=" #$output "/share/doc/"
+ #$(package-name this-package) "-"
+ #$(package-version this-package))
+ (string-append "CC=" #$(cc-for-target))))
+ ((#:phases phases '%standard-phases)
+ #~(modify-phases #$phases
+ ;; For GCC plugins.
+ (add-after 'unpack 'patch-gcc-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "src/afl-cc.c"
+ (("alt_cc = \"gcc\";")
+ (format #f "alt_cc = \"~a\";"
+ (search-input-file inputs "bin/gcc")))
+ (("alt_cxx = \"g\\+\\+\";")
+ (format #f "alt_cxx = \"~a\";"
+ (search-input-file inputs "bin/g++"))))))))))
+ ;; According to the Dockerfile, GCC 12 is producing compile errors for some
+ ;; targets, so explicitly use GCC 11 here.
+ (inputs (list gcc-11 gmp python qemu))
+ (native-inputs (list gcc-11))
+ (home-page "https://aflplus.plus/")
+ (description
+ "AFLplusplus is a security-oriented fuzzer that employs a novel type of
+compile-time instrumentation and genetic algorithms to automatically discover
+clean, interesting test cases that trigger new internal states in the targeted
+binary. This substantially improves the functional coverage for the fuzzed
+code. The compact synthesized corpora produced by the tool are also useful for
+seeding other, more labor- or resource-intensive testing regimes down the road.
+It is a fork of American Fuzzy Lop fuzzer and features:
+@itemize
+@item A more recent qemu version.
+@item More algorithms like collision-free coverage, enhanced laf-intel &
+redqueen, AFLfast++ power schedules, MOpt mutators, unicorn_mode, etc.
+@end itemize")))
+
(define-public stress-make
(let ((commit "97815bed8060de33952475b3498767c91f59ffd9")
(revision "2")) ;No official source distribution

base-commit: 3de361d9c9d320aefbd43710124d7b07af891de1
--
2.41.0
D
D
Denis 'GNUtoo' Carikli wrote on 24 Jan 01:09 +0100
(name . Hilton Chain)(address . hako@ultrarare.space)(address . 62666@debbugs.gnu.org)
20240124010945.21b016bf@primary_laptop
On Mon, 8 Jan 2024 16:19:00 +0800
Hilton Chain <hako@ultrarare.space> wrote:
Toggle quote (1 lines)
> Hi Denis,
Hi,

Toggle quote (10 lines)
> Aplogies for the long delay...
>
> I have adjusted the phases for proper cross-compilation support and
> updated the package to the latest version.
>
> I'm sending out v3 mainly for QA purpose, I'll push it if there's no
> further issue.
>
> Thanks

Thanks a lot for improving this patch.

I've a question though: in the mumi instance
(https://issues.guix.gnu.org/62666)it still says QA Unknown.

Do I need to do something on my side?

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmWwVUkACgkQX138wUF3
4mNRCxAAkhIHLJQ1HFG/1RuKyzchkRWr2Plh0aOjfw0tijWOrlSQcGLxVrNjMAQm
VOULEcMZsPqzq9EQZnVvKeIpR33cmB20MUEP8k6ErPjSOvBEZmGIbB7kYMbRPsUL
2LKWIySjzJIMADTAD3HaJH4apijeotLW4jqW+C48GVTemXYppiD1IjdOJn2/8ciF
MwFWk7Z9ciyGFwuIPVJRdUg6+yYUqIvG12aZlrnRi7NUr7fpJP4Q6WLCgIn118FV
S+wXZn5TWdNmZbCIqBR3x2bA+w7YLRzkFCTH022Qlzu/oJMp6P6sl8+XqN8gSDgH
YqqP9tUYWctGC08CKTkQ3rZX0nJOjLZjp1f+j+a32AkISyP2r0pgSiMB6z4lJ8f1
98AzriClLGMZekuqX6PM9oYLA8BdwtfNjfJrlPaO8WkpsaepvOqI3V7E4Z17e8IJ
pF/PBDjolGDxhFnJwthRHZgATGhAdjAqUvgjKMxxwq6a3kuDsxqE4Qtem8awjtCN
h56pRzsUluqbLRmoV7tFrQDkr1cRh2rD0xQtQe5O5M+KYgp5qrEnf4IbIy98PXpL
DkCjqKQhGWGox81ku0guVsA3YwDcvJ2rlWHaiigqp9D+bwg+rPy7nOzh72MGCXbi
vgyK3hg+HXW/8pgub9WUNBPL9Sk2IPCYUYM7nw/HOvtaC62DgkQ=
=bPWO
-----END PGP SIGNATURE-----


H
H
Hilton Chain wrote on 25 Jan 17:35 +0100
(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)(address . 62666-done@debbugs.gnu.org)
87zfwt1idd.wl-hako@ultrarare.space
Hi Denis,

On Wed, 24 Jan 2024 08:09:45 +0800,
Denis 'GNUtoo' Carikli wrote:
Toggle quote (24 lines)
>
> [1 <text/plain; US-ASCII (quoted-printable)>]
> On Mon, 8 Jan 2024 16:19:00 +0800
> Hilton Chain <hako@ultrarare.space> wrote:
> > Hi Denis,
> Hi,
>
> > Aplogies for the long delay...
> >
> > I have adjusted the phases for proper cross-compilation support and
> > updated the package to the latest version.
> >
> > I'm sending out v3 mainly for QA purpose, I'll push it if there's no
> > further issue.
> >
> > Thanks
>
> Thanks a lot for improving this patch.
>
> I've a question though: in the mumi instance
> (https://issues.guix.gnu.org/62666) it still says QA Unknown.
>
> Do I need to do something on my side?

Applied as 06221e910a5718c7d4ad2dcc7ffad2bc8e92fdc5 !
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 62666@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 62666
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch