X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=kconfig_hardened_check%2F__init__.py;h=e6d84edaafd5643bcf613e8c72fba401780e1ca8;hb=9c57a383ff4b0ee14aaa057302dc3bce6f8024bc;hp=859a5082dcf1cc153386584e7dcaae1adb06e71e;hpb=097c09122545b584439ee1fe9379bad04c66680c;p=kconfig-hardened-check.git diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 859a508..e6d84ed 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -18,7 +18,6 @@ # Аrch-independent: # mitigations=auto,nosmt (nosmt is slow) # X86: -# spectre_v2=on # spec_store_bypass_disable=on # l1tf=full,force # l1d_flush=on (a part of the l1tf option) @@ -701,6 +700,7 @@ def add_cmdline_checks(l, arch): l += [CmdlineCheck('self_protection', 'defconfig', 'nosmep', 'is not set')] l += [CmdlineCheck('self_protection', 'defconfig', 'nosmap', 'is not set')] l += [CmdlineCheck('self_protection', 'defconfig', 'nospectre_v1', 'is not set')] + l += [CmdlineCheck('self_protection', 'defconfig', 'nospectre_v2', 'is not set')] if arch == 'ARM64': l += [OR(CmdlineCheck('self_protection', 'defconfig', 'rodata', 'full'), AND(KconfigCheck('self_protection', 'defconfig', 'RODATA_FULL_DEFAULT_ENABLED', 'y'), @@ -746,7 +746,8 @@ def add_cmdline_checks(l, arch): # 'self_protection', 'clipos' l += [CmdlineCheck('self_protection', 'clipos', 'page_alloc.shuffle', '1')] - + if arch in ('X86_64', 'X86_32'): + l += [CmdlineCheck('self_protection', 'clipos', 'spectre_v2', 'on')] # 'cut_attack_surface', 'kspp' if arch == 'X86_64': @@ -906,6 +907,9 @@ def normalize_cmdline_options(option, value): if option == 'pti': # See pti_check_boottime_disable() in linux/arch/x86/mm/pti.c return value + if option == 'spectre_v2': + # See spectre_v2_parse_cmdline() in linux/arch/x86/kernel/cpu/bugs.c + return value if option == 'debugfs': # See debugfs_kernel() in fs/debugfs/inode.c return value