From 1d27115f1c05297bdd64869cbedd960db863e8b4 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Fri, 17 Feb 2023 20:12:52 +0300 Subject: [PATCH] Improve the 'mitigations' check Thanks to @izh1979 --- kconfig_hardened_check/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 83ab1eb..fa0b9e0 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -720,8 +720,6 @@ def add_cmdline_checks(l, arch): l += [CmdlineCheck('self_protection', 'defconfig', 'arm64.nobti', 'is not set')] l += [CmdlineCheck('self_protection', 'defconfig', 'arm64.nopauth', 'is not set')] l += [CmdlineCheck('self_protection', 'defconfig', 'arm64.nomte', 'is not set')] - l += [OR(CmdlineCheck('self_protection', 'defconfig', 'mitigations', 'is not off'), - CmdlineCheck('self_protection', 'defconfig', 'mitigations', 'is not set'))] l += [OR(CmdlineCheck('self_protection', 'defconfig', 'spectre_v2', 'is not off'), CmdlineCheck('self_protection', 'defconfig', 'spectre_v2', 'is not set'))] l += [OR(CmdlineCheck('self_protection', 'defconfig', 'spectre_v2_user', 'is not off'), @@ -757,6 +755,7 @@ def add_cmdline_checks(l, arch): # 'self_protection', 'kspp' l += [CmdlineCheck('self_protection', 'kspp', 'nosmt', 'is present')] + l += [CmdlineCheck('self_protection', 'kspp', 'mitigations', 'auto,nosmt')] # 'nosmt' by kspp + 'auto' by defconfig l += [OR(CmdlineCheck('self_protection', 'kspp', 'init_on_alloc', '1'), AND(KconfigCheck('self_protection', 'kspp', 'INIT_ON_ALLOC_DEFAULT_ON', 'y'), CmdlineCheck('self_protection', 'kspp', 'init_on_alloc', 'is not set')))] -- 2.31.1