Skip to content

Commit

Permalink
grsecurity: add 4.1 kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
tg-x committed Feb 28, 2016
1 parent 38614d3 commit be3bd97
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/security/grsecurity.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ in
kernelPatch = mkOption {
type = types.attrs;
default = pkgs.kernelPatches.grsecurity_latest;
example = pkgs.kernelPatches.grsecurity_4_1;
description = ''
Grsecurity patch to use.
'';
Expand Down
19 changes: 19 additions & 0 deletions pkgs/os-specific/linux/kernel/linux-grsecurity-4.1.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ stdenv, fetchurl, perl, buildLinux, ... } @ args:

import ./generic.nix (args // rec {
version = "4.1.7";
extraMeta.branch = "4.1";

src = fetchurl {
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
sha256 = "0g1dnvak0pd03d4miy1025bw64wq71w29a058dzspdr6jcf9qwbn";
};

kernelPatches = args.kernelPatches;

features.iwlwifi = true;
features.efiBootStub = true;
features.needsCifsUtils = true;
features.canDisableNetfilterConntrackHelpers = true;
features.netfilterRPFilter = true;
} // (args.argsOverride or {}))
8 changes: 8 additions & 0 deletions pkgs/os-specific/linux/kernel/patches.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ rec {
sha256 = "1sp1gwa7ahzflq7ayb51bg52abrn5zx1hb3pff3axpjqq7vfai6f";
};

grsecurity_4_1 = grsecPatch
{ kernel = pkgs.grsecurity_base_linux_4_1;
patches = [ grsecurity_fix_path_3_14 ];
kversion = "4.1.7";
revision = "201509201149";
sha256 = "1agv8c3c4vmh5algbzmrq2f6vwk72rikrlcbm4h7jbrb9js6fxk4";
};

grsecurity_4_4 = grsecPatch
{ kernel = pkgs.grsecurity_base_linux_4_4;
patches = [ grsecurity_fix_path_4_4 ];
Expand Down
17 changes: 17 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10418,6 +10418,15 @@ let
];
};

grsecurity_base_linux_4_1 = callPackage ../os-specific/linux/kernel/linux-grsecurity-4.1.nix {
kernelPatches = [ kernelPatches.bridge_stp_helper ]
++ lib.optionals ((platform.kernelArch or null) == "mips")
[ kernelPatches.mips_fpureg_emu
kernelPatches.mips_fpu_sigill
kernelPatches.mips_ext3_n32
];
};

grsecurity_base_linux_4_4 = callPackage ../os-specific/linux/kernel/linux-grsecurity-4.4.nix {
kernelPatches = [ kernelPatches.bridge_stp_helper ]
++ lib.optionals ((platform.kernelArch or null) == "mips")
Expand All @@ -10443,6 +10452,10 @@ let
linux_grsec_server_3_14 = grKernel kernelPatches.grsecurity_3_14 grFlavors.server;
linux_grsec_server_xen_3_14 = grKernel kernelPatches.grsecurity_3_14 grFlavors.server_xen;

linux_grsec_desktop_4_1 = grKernel kernelPatches.grsecurity_4_1 grFlavors.desktop;
linux_grsec_server_4_1 = grKernel kernelPatches.grsecurity_4_1 grFlavors.server;
linux_grsec_server_xen_4_1 = grKernel kernelPatches.grsecurity_4_1 grFlavors.server_xen;

linux_grsec_desktop_4_4 = grKernel kernelPatches.grsecurity_4_4 grFlavors.desktop;
linux_grsec_server_4_4 = grKernel kernelPatches.grsecurity_4_4 grFlavors.server;
linux_grsec_server_xen_4_4 = grKernel kernelPatches.grsecurity_4_4 grFlavors.server_xen;
Expand Down Expand Up @@ -10606,6 +10619,10 @@ let
linuxPackages_grsec_server_3_14 = grPackage kernelPatches.grsecurity_3_14 grFlavors.server;
linuxPackages_grsec_server_xen_3_14 = grPackage kernelPatches.grsecurity_3_14 grFlavors.server_xen;

linuxPackages_grsec_desktop_4_1 = grPackage kernelPatches.grsecurity_4_1 grFlavors.desktop;
linuxPackages_grsec_server_4_1 = grPackage kernelPatches.grsecurity_4_1 grFlavors.server;
linuxPackages_grsec_server_xen_4_1 = grPackage kernelPatches.grsecurity_4_1 grFlavors.server_xen;

linuxPackages_grsec_desktop_4_4 = grPackage kernelPatches.grsecurity_4_4 grFlavors.desktop;
linuxPackages_grsec_server_4_4 = grPackage kernelPatches.grsecurity_4_4 grFlavors.server;
linuxPackages_grsec_server_xen_4_4 = grPackage kernelPatches.grsecurity_4_4 grFlavors.server_xen;
Expand Down

0 comments on commit be3bd97

Please sign in to comment.