From be2c199661039422b9c9832b54b3569bef8dbe2f Mon Sep 17 00:00:00 2001 From: Raghav Gururajan via Guix-patches via Date: Thu, 9 Dec 2021 08:45:47 -0500 Subject: gnu: Add blacksmith. * gnu/packages/cybersecurity.scm (blacksmith): New variable. Signed-off-by: Nicolas Goaziou --- gnu/packages/cybersecurity.scm | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'gnu') diff --git a/gnu/packages/cybersecurity.scm b/gnu/packages/cybersecurity.scm index c61342c0ba..0801c00c4f 100644 --- a/gnu/packages/cybersecurity.scm +++ b/gnu/packages/cybersecurity.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 c4droid +;;; Copyright © 2021 Raghav Gururajan ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,10 +21,14 @@ (define-module (gnu packages cybersecurity) #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix packages) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system cmake) #:use-module (guix build-system python) + #:use-module (gnu packages cpp) #:use-module (gnu packages engineering) + #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages python-crypto) @@ -32,6 +37,68 @@ #:use-module (gnu packages bioinformatics) ;python-intervaltree #:use-module (gnu packages emulators)) +(define-public blacksmith + (package + (name "blacksmith") + (version "0.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/comsec-group/blacksmith") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0kyp71wndf527dgza5iks5m5vj543mvxp5w7cjd8x0pilmd1xrls")) + (modules '((guix build utils))) + (snippet `(begin + (delete-file-recursively "external") + (substitute* "CMakeLists.txt" + (("add_subdirectory\\(external\\)") "") + (("[ \t]*FetchContent_MakeAvailable\\(asmjit\\)") + (string-append + "find_package(asmjit)\n" + "find_package(nlohmann_json)"))))))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ;no test-suite + #:imported-modules + ((guix build copy-build-system) + ,@%cmake-build-system-modules) + #:modules + (((guix build copy-build-system) #:prefix copy:) + (guix build cmake-build-system) + (guix build utils)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-build + (lambda _ + (substitute* "CMakeLists.txt" + ;; Use default C++ standard instead. + (("cxx_std_17") "") + ;; This project tries to link argagg library, which doesn't + ;; exist, as argagg project is a single header file. + (("argagg") "")))) + (replace 'install + (lambda args + (apply (assoc-ref copy:%standard-phases 'install) + #:install-plan + '(("." "bin" #:include ("blacksmith")) + ("." "lib" #:include-regexp ("\\.a$"))) + args)))))) + (native-inputs + (list pkg-config)) + (inputs + (list argagg asmjit json-modern-cxx)) + (home-page "https://comsec.ethz.ch/research/dram/blacksmith") + (synopsis "Rowhammer fuzzer with non-uniform and frequency-based patterns") + (description + "Blacksmith is an implementation of Rowhammer fuzzer that crafts novel +non-uniform Rowhammer access patterns based on the concepts of frequency, +phase, and amplitude. It is able to bypass recent @acronym{TRR, Target Row +Refresh}in-DRAM mitigations effectively and as such can trigger bit flips.") + (license license:expat))) + (define-public ropgadget (package (name "ropgadget") -- cgit v1.2.3