From 616a7fe23791dafcffda580757dd463576290619 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Fri, 15 Sep 2017 21:07:33 +0000 Subject: [PATCH] linuxPackages: hardened-config: disable `BUG_ON_DATA_CORRUPTION` for older kernels They don't support it. --- pkgs/os-specific/linux/kernel/hardened-config.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/hardened-config.nix b/pkgs/os-specific/linux/kernel/hardened-config.nix index 7f1fb98789d..a8bbf4eba15 100644 --- a/pkgs/os-specific/linux/kernel/hardened-config.nix +++ b/pkgs/os-specific/linux/kernel/hardened-config.nix @@ -18,6 +18,10 @@ assert (versionAtLeast version "4.9"); # Report BUG() conditions and kill the offending process. BUG y +${optionalString (versionAtLeast version "4.10") '' + BUG_ON_DATA_CORRUPTION y +''} + ${optionalString (stdenv.system == "x86_64-linux") '' DEFAULT_MMAP_MIN_ADDR 65536 # Prevent allocation of first 64K of memory @@ -66,7 +70,6 @@ DEBUG_NOTIFIERS y DEBUG_LIST y DEBUG_SG y SCHED_STACK_END_CHECK y -BUG_ON_DATA_CORRUPTION y ${optionalString (versionAtLeast version "4.13") '' REFCOUNT_FULL y