From: Alexander Popov Date: Thu, 5 Jul 2018 11:44:04 +0000 (+0300) Subject: Consider 'not found' as an equivalent of 'is not set' X-Git-Tag: v0.5.2~92 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=a2b319a34868461ad29199c791e31ec0b2d896d7;p=kconfig-hardened-check.git Consider 'not found' as an equivalent of 'is not set' --- diff --git a/README.md b/README.md index 8d89888..9c7378d 100644 --- a/README.md +++ b/README.md @@ -70,13 +70,13 @@ Usage: ./kconfig-hardened-check.py [-p | -c ] CONFIG_DEBUG_CREDENTIALS | y | kspp | self_protection || FAIL: "is not set" CONFIG_DEBUG_NOTIFIERS | y | kspp | self_protection || FAIL: "is not set" CONFIG_MODULE_SIG_FORCE | y | kspp | self_protection || FAIL: "is not set" - CONFIG_HARDENED_USERCOPY_FALLBACK | is not set | kspp | self_protection || FAIL: not found + CONFIG_HARDENED_USERCOPY_FALLBACK | is not set | kspp | self_protection || OK: not found CONFIG_GCC_PLUGIN_STACKLEAK | y | my | self_protection || FAIL: not found CONFIG_SLUB_DEBUG_ON | y | my | self_protection || FAIL: "is not set" CONFIG_SECURITY_DMESG_RESTRICT | y | my | self_protection || FAIL: "is not set" CONFIG_STATIC_USERMODEHELPER | y | my | self_protection || FAIL: "is not set" - CONFIG_PAGE_POISONING_NO_SANITY | is not set | my | self_protection || FAIL: not found - CONFIG_PAGE_POISONING_ZERO | is not set | my | self_protection || FAIL: not found + CONFIG_PAGE_POISONING_NO_SANITY | is not set | my | self_protection || OK: not found + CONFIG_PAGE_POISONING_ZERO | is not set | my | self_protection || OK: not found CONFIG_SECURITY | y | ubuntu18 | security_policy || OK CONFIG_SECURITY_YAMA | y | ubuntu18 | security_policy || OK CONFIG_SECURITY_SELINUX_DISABLE | is not set | ubuntu18 | security_policy || OK @@ -127,7 +127,7 @@ Usage: ./kconfig-hardened-check.py [-p | -c ] CONFIG_ARCH_MMAP_RND_BITS | 32 | my |userspace_protection|| FAIL: "28" CONFIG_LKDTM | m | my | feature_test || FAIL: "is not set" -[-] config check is NOT PASSED: 55 errors +[-] config check is NOT PASSED: 52 errors ``` __Go and fix them all!__ diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index 4cd3527..e81cbe9 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -147,8 +147,11 @@ def print_check_results(): print(' ===========================================================================================================') for o in opt_list: if o[1] == '': - error_count += 1 - o[1] = 'FAIL: not found' + if o[0].state == 'is not set': + o[1] = 'OK: not found' + else: + error_count += 1 + o[1] = 'FAIL: not found' print(' CONFIG_{:<32}|{:^13}|{:^10}|{:^20}||{:^20}'.format(o[0].name, o[0].state, o[0].decision, o[0].reason, o[1])) print()