X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=kconfig-hardened-check.py;h=0975ba04042087fefe1ea9df5d57c4b62bc0b0b8;hb=5a2b22d70d1bf3610fb5ab94e63ee774f3a23421;hp=95a5edfca633132eeb3a8659362aee111da689ff;hpb=c2b4899fc4cf7b43dd560bf8890e87ecf48f3bdf;p=kconfig-hardened-check.git diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index 95a5edf..0975ba0 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -215,6 +215,7 @@ def construct_checklist(checklist, arch): if debug_mode or arch == 'ARM': checklist.append(OptCheck('VMSPLIT_3G', 'y', 'defconfig', 'self_protection')) checklist.append(OptCheck('CPU_SW_DOMAIN_PAN', 'y', 'defconfig', 'self_protection')) + checklist.append(OptCheck('STACKPROTECTOR_PER_TASK', 'y', 'defconfig', 'self_protection')) if debug_mode or arch == 'ARM64' or arch == 'ARM': checklist.append(OptCheck('REFCOUNT_FULL', 'y', 'defconfig', 'self_protection')) checklist.append(OptCheck('HARDEN_BRANCH_PREDICTOR', 'y', 'defconfig', 'self_protection')) @@ -289,8 +290,6 @@ def construct_checklist(checklist, arch): iommu_support_is_set)) if debug_mode or arch == 'X86_32': checklist.append(OptCheck('PAGE_TABLE_ISOLATION', 'y', 'my', 'self_protection')) - if debug_mode or arch == 'ARM': - checklist.append(OptCheck('STACKPROTECTOR_PER_TASK', 'y', 'my', 'self_protection')) if debug_mode or arch == 'X86_64' or arch == 'ARM64' or arch == 'X86_32': checklist.append(OptCheck('SECURITY', 'y', 'defconfig', 'security_policy')) # and choose your favourite LSM @@ -418,17 +417,15 @@ def print_checklist(checklist, with_results): print() -def get_option_state(options, name): - return options.get(name, None) - - def perform_checks(checklist, parsed_options): for opt in checklist: if hasattr(opt, 'opts'): + # prepare ComplexOptCheck for o in opt.opts: - o.state = get_option_state(parsed_options, o.name) + o.state = parsed_options.get(o.name, None) else: - opt.state = get_option_state(parsed_options, opt.name) + # prepare OptCheck + opt.state = parsed_options.get(opt.name, None) opt.check()