From patchwork Sat Nov 5 15:57:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 44337 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B915E27BBE9; Sat, 5 Nov 2022 15:59:08 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 95F3B27BBE9 for ; Sat, 5 Nov 2022 15:59:07 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orLZY-0005uI-Ip; Sat, 05 Nov 2022 11:59:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orLZW-0005s1-Us for guix-patches@gnu.org; Sat, 05 Nov 2022 11:59:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1orLZW-0005G3-MN for guix-patches@gnu.org; Sat, 05 Nov 2022 11:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1orLZW-0004lL-7w for guix-patches@gnu.org; Sat, 05 Nov 2022 11:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59053] [PATCH] gnu: Add spectre-meltdown-checker. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 05 Nov 2022 15:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59053 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59053@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166766389318245 (code B ref -1); Sat, 05 Nov 2022 15:59:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Nov 2022 15:58:13 +0000 Received: from localhost ([127.0.0.1]:57861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orLYf-0004k9-MP for submit@debbugs.gnu.org; Sat, 05 Nov 2022 11:58:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:44182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orLYT-0004jZ-7n for submit@debbugs.gnu.org; Sat, 05 Nov 2022 11:58:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orLYT-0005Mw-2E for guix-patches@gnu.org; Sat, 05 Nov 2022 11:57:57 -0400 Received: from mail.boiledscript.com ([144.168.59.46]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orLYR-000512-8J for guix-patches@gnu.org; Sat, 05 Nov 2022 11:57:56 -0400 Date: Sat, 05 Nov 2022 23:57:31 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1667663870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ttl4L85m1+0yZ08LJcm7GzOCew1V1+q69FtD9JJH3/c=; b=WXXOI4CLHWaWqLKVc4UlLUHsp5f6co6wmX0ARhOULAMexXC+YvE1r0enpoFYjQ1dcxbguL YwSBeusTFIt4uTks/ra7PbMbIp+67Q5z3dI7uKXKBy2zvix4DJdGusagLVNffwqVLAMNGY Mu5bgCDDt64fNRaaYZyx+4ovIgMqd/5Tv2HllzM8f8C73ciPUx55uvKOjUfD3QpdYYDguU UH4T9KBkR7pQGBmlnKyGAH5mERj90TQjgYWs/W7DQ36NXxJjaw4lWiWEWI2CGdv9gA9x0g cc2RijIjrNW/KG66vQ/Zwu8PnotWhL4KOnS7hqVWwhs19xxd+izty1RA6wZwuA== Message-ID: MIME-Version: 1.0 X-Spamd-Bar: / Authentication-Results: mail.boiledscript.com; auth=pass smtp.mailfrom=hako@ultrarare.space Received-SPF: pass client-ip=144.168.59.46; envelope-from=hako@ultrarare.space; helo=mail.boiledscript.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-patches" Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches X-Patchwork-Original-From: Hilton Chain via Guix-patches via From: Hilton Chain Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/spectre-meltdown-checker-support-guix-system-kernel.patch: New file. * gnu/packages/linux.scm (spectre-meltdown-checker): New variable. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/linux.scm | 41 +++++++++++++++++++ ...n-checker-support-guix-system-kernel.patch | 26 ++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 gnu/packages/patches/spectre-meltdown-checker-support-guix-system-kernel.patch base-commit: 2211f50ec1ebcf5f880454b4133ac40e41abac21 diff --git a/gnu/local.mk b/gnu/local.mk index eb6ac3df58..88c1fa6278 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1848,6 +1848,7 @@ dist_patch_DATA = \ %D%/packages/patches/syslinux-strip-gnu-property.patch \ %D%/packages/patches/snappy-add-O2-flag-in-CmakeLists.txt.patch \ %D%/packages/patches/snappy-add-inline-for-GCC.patch \ + %D%/packages/patches/spectre-meltdown-checker-support-guix-system-kernel.patch \ %D%/packages/patches/sphinxbase-fix-doxygen.patch \ %D%/packages/patches/spice-vdagent-glib-2.68.patch \ %D%/packages/patches/sssd-optional-systemd.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index cf11a7fc1b..db199869a7 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -9512,3 +9512,44 @@ (define-public tp-smapi-module @acronym{SMAPI, System Management Application Program Interface} and direct access to the embedded controller.") (license license:gpl2+))) + +(define-public spectre-meltdown-checker + (package + (name "spectre-meltdown-checker") + (version "0.45") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/speed47/spectre-meltdown-checker") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (patches + (search-patches + ;; https://github.com/speed47/spectre-meltdown-checker/pull/441 + "spectre-meltdown-checker-support-guix-system-kernel.patch")) + (sha256 + (base32 + "1xx8h5791lhc2xw0dcbzjkklzvlxwxkjzh8di4g8divfy24fqsn8")))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~'(("spectre-meltdown-checker.sh" "bin/spectre-meltdown-checker")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fixpath + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "spectre-meltdown-checker.sh" + (("\\$\\{opt_arch_prefix\\}readelf") + (search-input-file inputs "/bin/readelf")) + (("perl") + (search-input-file inputs "/bin/perl")))))))) + (inputs (list binutils perl)) + (home-page "https://github.com/speed47/spectre-meltdown-checker") + (synopsis + "Spectre, Meltdown, Foreshadow, Fallout, RIDL, ZombieLoad vulnerability / +mitigation checker for Linux & BSD") + (description + "A shell script to assess your system's resilience against the several +transient execution CVEs that were published since early 2018, and give you +guidance as to how to mitigate them.") + (license license:gpl3))) diff --git a/gnu/packages/patches/spectre-meltdown-checker-support-guix-system-kernel.patch b/gnu/packages/patches/spectre-meltdown-checker-support-guix-system-kernel.patch new file mode 100644 index 0000000000..afec52b418 --- /dev/null +++ b/gnu/packages/patches/spectre-meltdown-checker-support-guix-system-kernel.patch @@ -0,0 +1,26 @@ +From 5b757d930ec0cf102b03fb9817d17e06c72e74b3 Mon Sep 17 00:00:00 2001 +From: Hilton Chain +Date: Sat, 5 Nov 2022 23:22:31 +0800 +Subject: [PATCH] Add support for Guix System kernel. + +--- + spectre-meltdown-checker.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh +index 248a444..855a090 100755 +--- a/spectre-meltdown-checker.sh ++++ b/spectre-meltdown-checker.sh +@@ -2251,6 +2251,8 @@ if [ "$opt_live" = 1 ]; then + [ -e "/boot/kernel-genkernel-$(uname -m)-$(uname -r)" ] && opt_kernel="/boot/kernel-genkernel-$(uname -m)-$(uname -r)" + # NixOS: + [ -e "/run/booted-system/kernel" ] && opt_kernel="/run/booted-system/kernel" ++ # Guix System: ++ [ -e "/run/booted-system/kernel/bzImage" ] && opt_kernel="/run/booted-system/kernel/bzImage" + # systemd kernel-install: + [ -e "/etc/machine-id" ] && [ -e "/boot/$(cat /etc/machine-id)/$(uname -r)/linux" ] && opt_kernel="/boot/$(cat /etc/machine-id)/$(uname -r)/linux" + # Clear Linux: + +base-commit: a6c943d38f315f339697ec26e7374a09b88f2183 +-- +2.38.0