From 50664aa003afbede7ed8d7b613b72131e6bb080b Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Mon, 14 Dec 2020 12:51:16 -0500 Subject: [PATCH 01/16] linux: Add 5.10 Validated via ``` nix-build ./nixos/release.nix -A tests.kernel-latest.x86_64-linux -A tests.latestKernel.login.x86_64-linux ``` (cherry picked from commit c1ef6d2f410c77e3a1b1b0796a35909cafba7d01) --- pkgs/os-specific/linux/kernel/linux-5.10.nix | 18 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 11 ++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/linux/kernel/linux-5.10.nix diff --git a/pkgs/os-specific/linux/kernel/linux-5.10.nix b/pkgs/os-specific/linux/kernel/linux-5.10.nix new file mode 100644 index 000000000000..f1527c5bd92e --- /dev/null +++ b/pkgs/os-specific/linux/kernel/linux-5.10.nix @@ -0,0 +1,18 @@ +{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args: + +with stdenv.lib; + +buildLinux (args // rec { + version = "5.10"; + + # modDirVersion needs to be x.y.z, will automatically add .0 if needed + modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; + + # branchVersion needs to be x.y + extraMeta.branch = versions.majorMinor version; + + src = fetchurl { + url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; + sha256 = "sha256-3N+Z5D6YMw2SUBaYW/vHuDxm02e3FLLeDLv8v4PYykM="; + }; +} // (args.argsOverride or {})) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f2df7ab733ec..d44561aa7374 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17699,6 +17699,14 @@ in ]; }; + linux_5_10 = callPackage ../os-specific/linux/kernel/linux-5.10.nix { + kernelPatches = [ + kernelPatches.bridge_stp_helper + kernelPatches.request_key_helper + kernelPatches.export_kernel_fpu_functions."5.3" + ]; + }; + linux_testing = callPackage ../os-specific/linux/kernel/linux-testing.nix { kernelPatches = [ kernelPatches.bridge_stp_helper @@ -17934,7 +17942,7 @@ in # Update this when adding the newest kernel major version! # And update linux_latest_for_hardened below if the patches are already available - linuxPackages_latest = linuxPackages_5_9; + linuxPackages_latest = linuxPackages_5_10; linux_latest = linuxPackages_latest.kernel; # Realtime kernel packages. @@ -17958,6 +17966,7 @@ in linuxPackages_5_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_4); linuxPackages_5_8 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_8); linuxPackages_5_9 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_9); + linuxPackages_5_10 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_10); # When adding to the list above: # - Update linuxPackages_latest to the latest version From 412c56abf2c348b994e4affd807dacb556adcbaa Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Tue, 15 Dec 2020 12:33:20 -0500 Subject: [PATCH 02/16] linux: 5.10 -> 5.10.1 (cherry picked from commit a83bf32bab63288fb8c0273c9600161ce6d15276) --- pkgs/os-specific/linux/kernel/linux-5.10.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-5.10.nix b/pkgs/os-specific/linux/kernel/linux-5.10.nix index f1527c5bd92e..db7ff9c912a5 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.10.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.10.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "5.10"; + version = "5.10.1"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "sha256-3N+Z5D6YMw2SUBaYW/vHuDxm02e3FLLeDLv8v4PYykM="; + sha256 = "0p2fl7kl4ckphq17xir7n7vgrzlhbdqmyd2yyp4yilwvih9625pd"; }; } // (args.argsOverride or {})) From 09d78d08da2fb72bf72887b568761086c7c8319f Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Mon, 21 Dec 2020 10:51:06 -0500 Subject: [PATCH 03/16] linux: 5.10.1 -> 5.10.2 (cherry picked from commit 9dc0ab949b7e5310582d2b7204205ed43b40907d) --- pkgs/os-specific/linux/kernel/linux-5.10.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-5.10.nix b/pkgs/os-specific/linux/kernel/linux-5.10.nix index db7ff9c912a5..411a88d92934 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.10.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.10.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "5.10.1"; + version = "5.10.2"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "0p2fl7kl4ckphq17xir7n7vgrzlhbdqmyd2yyp4yilwvih9625pd"; + sha256 = "18l1ywp99inm90434fm74w8rjfl4yl974kfcpizg2sp2p8xf311v"; }; } // (args.argsOverride or {})) From 75e95c9f439c6d8849d75023669d44be9040e791 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Mon, 28 Dec 2020 10:19:22 -0500 Subject: [PATCH 04/16] linux: 5.10.2 -> 5.10.3 (cherry picked from commit b24e814e14d16bd76abda0017237dc1e2054d798) --- pkgs/os-specific/linux/kernel/linux-5.10.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-5.10.nix b/pkgs/os-specific/linux/kernel/linux-5.10.nix index 411a88d92934..783e7cf2d968 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.10.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.10.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "5.10.2"; + version = "5.10.3"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "18l1ywp99inm90434fm74w8rjfl4yl974kfcpizg2sp2p8xf311v"; + sha256 = "09cml495fnf52lhlkjxjznw34q5s8arvq7shkb6wjq6fwlrk65gr"; }; } // (args.argsOverride or {})) From 823be7a97fd4f6c091fb7a191a42b9650ce16742 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Wed, 30 Dec 2020 21:15:02 -0500 Subject: [PATCH 05/16] linux: 5.10.3 -> 5.10.4 (cherry picked from commit 3785b180bab6a8170db6ef768bb4b616a4133700) --- pkgs/os-specific/linux/kernel/linux-5.10.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-5.10.nix b/pkgs/os-specific/linux/kernel/linux-5.10.nix index 783e7cf2d968..abe28da81269 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.10.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.10.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "5.10.3"; + version = "5.10.4"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "09cml495fnf52lhlkjxjznw34q5s8arvq7shkb6wjq6fwlrk65gr"; + sha256 = "1v2nbpp21c3fkw23dgrrfznnnlvi0538kj8wrlb2m6g94rn3jklh"; }; } // (args.argsOverride or {})) From 202f7ade703d7d49fc8480c990f582f354b6efb4 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Wed, 6 Jan 2021 11:27:31 -0500 Subject: [PATCH 06/16] linux: 5.10.4 -> 5.10.5 (cherry picked from commit 6d1f725cf677733e7c3621024b5aa113267f2130) --- pkgs/os-specific/linux/kernel/linux-5.10.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-5.10.nix b/pkgs/os-specific/linux/kernel/linux-5.10.nix index abe28da81269..28f031431839 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.10.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.10.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "5.10.4"; + version = "5.10.5"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "1v2nbpp21c3fkw23dgrrfznnnlvi0538kj8wrlb2m6g94rn3jklh"; + sha256 = "1x1fc4cywqnjm514q376d5540zsxmqv95n0lykaphz8qdbhsk49r"; }; } // (args.argsOverride or {})) From 6b7e8bcd71bd67badbfb1979475e1ce65a115ac5 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Wed, 30 Dec 2020 21:18:49 -0500 Subject: [PATCH 07/16] linux/hardened/patches/5.10: init at 5.10.4.a (cherry picked from commit 5f4c27eb77ae9bba38f81fb51ab3ce958d821006) --- pkgs/os-specific/linux/kernel/hardened/patches.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/os-specific/linux/kernel/hardened/patches.json b/pkgs/os-specific/linux/kernel/hardened/patches.json index d129afda4681..2fbcc16306b2 100644 --- a/pkgs/os-specific/linux/kernel/hardened/patches.json +++ b/pkgs/os-specific/linux/kernel/hardened/patches.json @@ -9,6 +9,11 @@ "sha256": "0fzv2sjmf0dmhzp58yr4ggzi3pxbjjhbhmav46pv98rbdm2vjwvk", "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.19.164.a/linux-hardened-4.19.164.a.patch" }, + "5.10": { + "name": "linux-hardened-5.10.4.a.patch", + "sha256": "0apnmcis41vz5k74g1ssq0apwxzhl6zg31nyjbplilm3b068a1h4", + "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.10.4.a/linux-hardened-5.10.4.a.patch" + }, "5.4": { "name": "linux-hardened-5.4.86.a.patch", "sha256": "0j1wr6d42rbxd66vhsp9l3lp3nv0p1j0cpir9pxshd8w9zlbdy88", From c00fcdfe81ff1d3ff767c577a6ac720f67c4ac09 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Fri, 18 Dec 2020 20:28:48 -0500 Subject: [PATCH 08/16] linux-hardened: Switch to 5.10 (cherry picked from commit ed4d6a8eff74b3b6e372778b64d9a90e6c8c93aa) --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d44561aa7374..886312218d2a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18004,7 +18004,7 @@ in # Hardened Linux hardenedLinuxPackagesFor = kernel': overrides: let # Note: We use this hack since the hardened patches can lag behind and we don't want to delay updates: - linux_latest_for_hardened = pkgs.linux_5_9; + linux_latest_for_hardened = pkgs.linux_5_10; kernel = (if kernel' == pkgs.linux_latest then linux_latest_for_hardened else kernel').override overrides; in linuxPackagesFor (kernel.override { structuredExtraConfig = import ../os-specific/linux/kernel/hardened/config.nix { From 6205febf4127428485560708a10a7fe0378bc0fe Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Wed, 6 Jan 2021 14:41:54 -0500 Subject: [PATCH 09/16] linux: Remove 5.8 Kernel version is EOL --- pkgs/os-specific/linux/kernel/linux-5.8.nix | 18 ------------------ pkgs/top-level/all-packages.nix | 9 --------- 2 files changed, 27 deletions(-) delete mode 100644 pkgs/os-specific/linux/kernel/linux-5.8.nix diff --git a/pkgs/os-specific/linux/kernel/linux-5.8.nix b/pkgs/os-specific/linux/kernel/linux-5.8.nix deleted file mode 100644 index dd11359dbf41..000000000000 --- a/pkgs/os-specific/linux/kernel/linux-5.8.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args: - -with stdenv.lib; - -buildLinux (args // rec { - version = "5.8.18"; - - # modDirVersion needs to be x.y.z, will automatically add .0 if needed - modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; - - # branchVersion needs to be x.y - extraMeta.branch = versions.majorMinor version; - - src = fetchurl { - url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "0d2mm16mjyl2d734ak0lj8vd76h3r0san7l7g2zczd5pjkva7d2a"; - }; -} // (args.argsOverride or {})) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 886312218d2a..2efd1b2762a2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17683,14 +17683,6 @@ in ]; }; - linux_5_8 = callPackage ../os-specific/linux/kernel/linux-5.8.nix { - kernelPatches = [ - kernelPatches.bridge_stp_helper - kernelPatches.request_key_helper - kernelPatches.export_kernel_fpu_functions."5.3" - ]; - }; - linux_5_9 = callPackage ../os-specific/linux/kernel/linux-5.9.nix { kernelPatches = [ kernelPatches.bridge_stp_helper @@ -17964,7 +17956,6 @@ in linuxPackages_4_14 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_14); linuxPackages_4_19 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_19); linuxPackages_5_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_4); - linuxPackages_5_8 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_8); linuxPackages_5_9 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_9); linuxPackages_5_10 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_10); From 390cc182656ac0c3bc21735b1363bf62ade1484c Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Wed, 6 Jan 2021 14:42:51 -0500 Subject: [PATCH 10/16] linux: Remove 5.9 Kernel version is EOL --- pkgs/os-specific/linux/kernel/linux-5.9.nix | 18 ------------------ pkgs/top-level/all-packages.nix | 9 --------- 2 files changed, 27 deletions(-) delete mode 100644 pkgs/os-specific/linux/kernel/linux-5.9.nix diff --git a/pkgs/os-specific/linux/kernel/linux-5.9.nix b/pkgs/os-specific/linux/kernel/linux-5.9.nix deleted file mode 100644 index 39cc9c56c5fc..000000000000 --- a/pkgs/os-specific/linux/kernel/linux-5.9.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args: - -with stdenv.lib; - -buildLinux (args // rec { - version = "5.9.16"; - - # modDirVersion needs to be x.y.z, will automatically add .0 if needed - modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; - - # branchVersion needs to be x.y - extraMeta.branch = versions.majorMinor version; - - src = fetchurl { - url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "11mbnjvb5d5gwbrwlkqvzpg1ij4m19l5wr3wca9iiyg5i2papmxh"; - }; -} // (args.argsOverride or {})) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2efd1b2762a2..922d1272e80d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17683,14 +17683,6 @@ in ]; }; - linux_5_9 = callPackage ../os-specific/linux/kernel/linux-5.9.nix { - kernelPatches = [ - kernelPatches.bridge_stp_helper - kernelPatches.request_key_helper - kernelPatches.export_kernel_fpu_functions."5.3" - ]; - }; - linux_5_10 = callPackage ../os-specific/linux/kernel/linux-5.10.nix { kernelPatches = [ kernelPatches.bridge_stp_helper @@ -17956,7 +17948,6 @@ in linuxPackages_4_14 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_14); linuxPackages_4_19 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_19); linuxPackages_5_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_4); - linuxPackages_5_9 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_9); linuxPackages_5_10 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_5_10); # When adding to the list above: From 5095099e034080ce75a431bc6f2a03f6a59cd232 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Thu, 7 Jan 2021 10:11:56 -0500 Subject: [PATCH 11/16] linux/hardened/patches/5.10: 5.10.4.a -> 5.10.5.a (cherry picked from commit 91e76b146f7ee8fc894192809261122f49471f82) --- pkgs/os-specific/linux/kernel/hardened/patches.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/hardened/patches.json b/pkgs/os-specific/linux/kernel/hardened/patches.json index 2fbcc16306b2..f41e0fb494c1 100644 --- a/pkgs/os-specific/linux/kernel/hardened/patches.json +++ b/pkgs/os-specific/linux/kernel/hardened/patches.json @@ -10,9 +10,9 @@ "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.19.164.a/linux-hardened-4.19.164.a.patch" }, "5.10": { - "name": "linux-hardened-5.10.4.a.patch", - "sha256": "0apnmcis41vz5k74g1ssq0apwxzhl6zg31nyjbplilm3b068a1h4", - "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.10.4.a/linux-hardened-5.10.4.a.patch" + "name": "linux-hardened-5.10.5.a.patch", + "sha256": "1fq2n60brhi6wjazkdgj2aqc4maskvlymbznl03hvj0x5kahjxvx", + "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.10.5.a/linux-hardened-5.10.5.a.patch" }, "5.4": { "name": "linux-hardened-5.4.86.a.patch", From 3d1b69f958abe597aa38f02d554b633870feb0ef Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Thu, 7 Jan 2021 10:11:58 -0500 Subject: [PATCH 12/16] linux/hardened/patches/5.4: 5.4.86.a -> 5.4.87.a (cherry picked from commit 2fe7c5cb860343fd356b356d861ffdcfaac57186) --- pkgs/os-specific/linux/kernel/hardened/patches.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/hardened/patches.json b/pkgs/os-specific/linux/kernel/hardened/patches.json index f41e0fb494c1..7f0b521a93a5 100644 --- a/pkgs/os-specific/linux/kernel/hardened/patches.json +++ b/pkgs/os-specific/linux/kernel/hardened/patches.json @@ -15,9 +15,9 @@ "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.10.5.a/linux-hardened-5.10.5.a.patch" }, "5.4": { - "name": "linux-hardened-5.4.86.a.patch", - "sha256": "0j1wr6d42rbxd66vhsp9l3lp3nv0p1j0cpir9pxshd8w9zlbdy88", - "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.4.86.a/linux-hardened-5.4.86.a.patch" + "name": "linux-hardened-5.4.87.a.patch", + "sha256": "01hpww6lm00iry8z4z86hh86x66h3xbmxknxhmmhh2zwz6ahkmfd", + "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.4.87.a/linux-hardened-5.4.87.a.patch" }, "5.8": { "name": "linux-hardened-5.8.18.a.patch", From af50a34fbf2852fce013b61aff6d54af3fc8eb2f Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Thu, 7 Jan 2021 10:11:50 -0500 Subject: [PATCH 13/16] linux/hardened/patches/4.19: 4.19.164.a -> 4.19.165.a (cherry picked from commit 2a23529200a858f1615b50e452abc9a91ad46367) --- pkgs/os-specific/linux/kernel/hardened/patches.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/hardened/patches.json b/pkgs/os-specific/linux/kernel/hardened/patches.json index 7f0b521a93a5..ccdfb36154b3 100644 --- a/pkgs/os-specific/linux/kernel/hardened/patches.json +++ b/pkgs/os-specific/linux/kernel/hardened/patches.json @@ -5,9 +5,9 @@ "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.14.213.a/linux-hardened-4.14.213.a.patch" }, "4.19": { - "name": "linux-hardened-4.19.164.a.patch", - "sha256": "0fzv2sjmf0dmhzp58yr4ggzi3pxbjjhbhmav46pv98rbdm2vjwvk", - "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.19.164.a/linux-hardened-4.19.164.a.patch" + "name": "linux-hardened-4.19.165.a.patch", + "sha256": "06v34jaj4jg6f3v05wbkkfnr69ahxqyyq0gam4ma3wgm74x6cf3s", + "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.19.165.a/linux-hardened-4.19.165.a.patch" }, "5.10": { "name": "linux-hardened-5.10.5.a.patch", From 7e6e434c364fdff533a8669b0108b85bb3dbcc74 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Thu, 7 Jan 2021 14:39:27 -0500 Subject: [PATCH 14/16] linux-hardened: Track extra version Fixes #108707 (cherry picked from commit 4312cd74f13574cbe6a13c33064482964e4c5853) --- pkgs/os-specific/linux/kernel/hardened/patches.json | 5 +++++ pkgs/os-specific/linux/kernel/hardened/update.py | 11 +++++++---- pkgs/os-specific/linux/kernel/patches.nix | 3 ++- pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/hardened/patches.json b/pkgs/os-specific/linux/kernel/hardened/patches.json index ccdfb36154b3..5f9bc18d7b19 100644 --- a/pkgs/os-specific/linux/kernel/hardened/patches.json +++ b/pkgs/os-specific/linux/kernel/hardened/patches.json @@ -1,20 +1,24 @@ { "4.14": { + "extra": "", "name": "linux-hardened-4.14.213.a.patch", "sha256": "0lkjgg6cbsaiypxij7p00q3y094qf0h172hc2p7wgy39777b45a7", "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.14.213.a/linux-hardened-4.14.213.a.patch" }, "4.19": { + "extra": ".a", "name": "linux-hardened-4.19.165.a.patch", "sha256": "06v34jaj4jg6f3v05wbkkfnr69ahxqyyq0gam4ma3wgm74x6cf3s", "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.19.165.a/linux-hardened-4.19.165.a.patch" }, "5.10": { + "extra": ".a", "name": "linux-hardened-5.10.5.a.patch", "sha256": "1fq2n60brhi6wjazkdgj2aqc4maskvlymbznl03hvj0x5kahjxvx", "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.10.5.a/linux-hardened-5.10.5.a.patch" }, "5.4": { + "extra": ".a", "name": "linux-hardened-5.4.87.a.patch", "sha256": "01hpww6lm00iry8z4z86hh86x66h3xbmxknxhmmhh2zwz6ahkmfd", "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.4.87.a/linux-hardened-5.4.87.a.patch" @@ -25,6 +29,7 @@ "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.8.18.a/linux-hardened-5.8.18.a.patch" }, "5.9": { + "extra": "", "name": "linux-hardened-5.9.16.a.patch", "sha256": "024wdzc9bwgr4nd4z0l6bazcl35jczhsmdl2lb26bvffjwg207rw", "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.9.16.a/linux-hardened-5.9.16.a.patch" diff --git a/pkgs/os-specific/linux/kernel/hardened/update.py b/pkgs/os-specific/linux/kernel/hardened/update.py index d6443d2e7511..b831c6491095 100755 --- a/pkgs/os-specific/linux/kernel/hardened/update.py +++ b/pkgs/os-specific/linux/kernel/hardened/update.py @@ -31,7 +31,7 @@ VersionComponent = Union[int, str] Version = List[VersionComponent] -Patch = TypedDict("Patch", {"name": str, "url": str, "sha256": str}) +Patch = TypedDict("Patch", {"name": str, "url": str, "sha256": str, "extra": str}) @dataclass @@ -99,7 +99,10 @@ def verify_openpgp_signature( return False -def fetch_patch(*, name: str, release: GitRelease) -> Optional[Patch]: +def fetch_patch(*, name: str, release_info: ReleaseInfo) -> Optional[Patch]: + release = release_info.release + extra = f'.{release_info.version[-1]}' + def find_asset(filename: str) -> str: try: it: Iterator[str] = ( @@ -130,7 +133,7 @@ def fetch_patch(*, name: str, release: GitRelease) -> Optional[Patch]: if not sig_ok: return None - return Patch(name=patch_filename, url=patch_url, sha256=sha256) + return Patch(name=patch_filename, url=patch_url, sha256=sha256, extra=extra) def parse_version(version_str: str) -> Version: @@ -252,7 +255,7 @@ for kernel_key in sorted(releases.keys()): update = True if update: - patch = fetch_patch(name=name, release=release) + patch = fetch_patch(name=name, release_info=release_info) if patch is None: failures = True else: diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix index 8ce1ac2b587c..1546de18241a 100644 --- a/pkgs/os-specific/linux/kernel/patches.nix +++ b/pkgs/os-specific/linux/kernel/patches.nix @@ -41,7 +41,8 @@ hardened = let mkPatch = kernelVersion: src: { name = lib.removeSuffix ".patch" src.name; - patch = fetchurl src; + patch = fetchurl (lib.filterAttrs (k: v: k != "extra") src); + extra = src.extra; }; patches = builtins.fromJSON (builtins.readFile ./hardened/patches.json); in lib.mapAttrs mkPatch patches; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 922d1272e80d..b5344a451572 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17997,7 +17997,7 @@ in kernelPatches.tag_hardened kernelPatches.hardened.${kernel.meta.branch} ]; - modDirVersionArg = kernel.modDirVersion + "-hardened"; + modDirVersionArg = kernel.modDirVersion + (kernelPatches.hardened.${kernel.meta.branch}).extra + "-hardened"; isHardened = true; }); From 384095ff393c5a93fef0a911da730f89a2b3e29c Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Thu, 7 Jan 2021 18:43:45 -0500 Subject: [PATCH 15/16] linux-hardened: Add extra to 5.8 --- pkgs/os-specific/linux/kernel/hardened/patches.json | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/linux/kernel/hardened/patches.json b/pkgs/os-specific/linux/kernel/hardened/patches.json index 5f9bc18d7b19..77df4fc6cc81 100644 --- a/pkgs/os-specific/linux/kernel/hardened/patches.json +++ b/pkgs/os-specific/linux/kernel/hardened/patches.json @@ -24,6 +24,7 @@ "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.4.87.a/linux-hardened-5.4.87.a.patch" }, "5.8": { + "extra": "", "name": "linux-hardened-5.8.18.a.patch", "sha256": "1r2n74nbyi3dp5zql9sk504xkpil6ylbyd99zqqva4nd3qg17c99", "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.8.18.a/linux-hardened-5.8.18.a.patch" From 074a3ddf52ae69b6df8a113822a60a64f757fa07 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Thu, 7 Jan 2021 18:49:44 -0500 Subject: [PATCH 16/16] linux-hardened: Remove 5.8 and 5.9 --- pkgs/os-specific/linux/kernel/hardened/patches.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/hardened/patches.json b/pkgs/os-specific/linux/kernel/hardened/patches.json index 77df4fc6cc81..395193ca7679 100644 --- a/pkgs/os-specific/linux/kernel/hardened/patches.json +++ b/pkgs/os-specific/linux/kernel/hardened/patches.json @@ -22,17 +22,5 @@ "name": "linux-hardened-5.4.87.a.patch", "sha256": "01hpww6lm00iry8z4z86hh86x66h3xbmxknxhmmhh2zwz6ahkmfd", "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.4.87.a/linux-hardened-5.4.87.a.patch" - }, - "5.8": { - "extra": "", - "name": "linux-hardened-5.8.18.a.patch", - "sha256": "1r2n74nbyi3dp5zql9sk504xkpil6ylbyd99zqqva4nd3qg17c99", - "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.8.18.a/linux-hardened-5.8.18.a.patch" - }, - "5.9": { - "extra": "", - "name": "linux-hardened-5.9.16.a.patch", - "sha256": "024wdzc9bwgr4nd4z0l6bazcl35jczhsmdl2lb26bvffjwg207rw", - "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.9.16.a/linux-hardened-5.9.16.a.patch" } }