X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=kconfig_hardened_check%2F__init__.py;h=1ca05301efe69c1fcc2f0d24c8733ad2d5e7151c;hb=e165289160f071b9e1016af366b2a0e3948566ad;hp=3e6e6096d036ae889f6afc05db8174e1b8a113e7;hpb=45bb1e8f0e193715e0b0072929f063b765b78287;p=kconfig-hardened-check.git diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 3e6e609..1ca0530 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -225,9 +225,11 @@ class AND(ComplexOptCheck): if not ret: # This FAIL is caused by additional checks, # and not by the main option that this AND-check is about. - if opt.result.startswith('FAIL: \"'): - # Describe the reason of the FAIL. + # Describe the reason of the FAIL. + if opt.result.startswith('FAIL: \"') or opt.result == 'FAIL: not found': self.result = 'FAIL: CONFIG_{} not "{}"'.format(opt.name, opt.expected) + elif opt.result == 'FAIL: not present': + self.result = 'FAIL: CONFIG_{} not present'.format(opt.name) else: # This FAIL message is self-explaining. self.result = opt.result @@ -352,7 +354,7 @@ def construct_checklist(l, arch): l += [OR(OptCheck('self_protection', 'kspp', 'INIT_STACK_ALL', 'y'), OptCheck('self_protection', 'kspp', 'GCC_PLUGIN_STRUCTLEAK_BYREF_ALL', 'y'))] l += [OR(OptCheck('self_protection', 'kspp', 'INIT_ON_FREE_DEFAULT_ON', 'y'), - OptCheck('self_protection', 'kspp', 'PAGE_POISONING', 'y'))] # before v5.3 + OptCheck('self_protection', 'kspp', 'PAGE_POISONING_ZERO', 'y'))] # before v5.3 if arch in ('X86_64', 'ARM64', 'X86_32'): stackleak_is_set = OptCheck('self_protection', 'kspp', 'GCC_PLUGIN_STACKLEAK', 'y') l += [stackleak_is_set] @@ -393,6 +395,9 @@ def construct_checklist(l, arch): iommu_support_is_set)] # 'self_protection', 'my' + l += [AND(OptCheck('self_protection', 'my', 'UBSAN_BOUNDS', 'y'), + OptCheck('self_protection', 'my', 'UBSAN_MISC', 'is not set'), + OptCheck('self_protection', 'my', 'UBSAN_TRAP', 'y'))] l += [OptCheck('self_protection', 'my', 'SLUB_DEBUG_ON', 'y')] # TODO: is it better to set that via kernel cmd? l += [OptCheck('self_protection', 'my', 'RESET_ATTACK_MITIGATION', 'y')] # needs userspace support (systemd) if arch == 'X86_64':