From c83dc6c7c804987999296afba385b2349bdda9ac Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 12 Mar 2019 17:12:14 +0300 Subject: [PATCH] Use the AND check for HARDENED_USERCOPY_FALLBACK If HARDENED_USERCOPY is not set, HARDENED_USERCOPY_FALLBACK is not checked. Refers to issue #13. --- kconfig-hardened-check.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index 0f552b2..5ef937c 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -193,8 +193,6 @@ def construct_checklist(arch): checklist.append(OptCheck('SCHED_STACK_END_CHECK', 'y', 'kspp', 'self_protection')) checklist.append(OptCheck('SLAB_FREELIST_HARDENED', 'y', 'kspp', 'self_protection')) checklist.append(OptCheck('SLAB_FREELIST_RANDOM', 'y', 'kspp', 'self_protection')) - checklist.append(OptCheck('HARDENED_USERCOPY', 'y', 'kspp', 'self_protection')) - checklist.append(OptCheck('HARDENED_USERCOPY_FALLBACK', 'is not set', 'kspp', 'self_protection')) checklist.append(OptCheck('FORTIFY_SOURCE', 'y', 'kspp', 'self_protection')) checklist.append(OptCheck('GCC_PLUGINS', 'y', 'kspp', 'self_protection')) checklist.append(OptCheck('GCC_PLUGIN_RANDSTRUCT', 'y', 'kspp', 'self_protection')) @@ -207,6 +205,10 @@ def construct_checklist(arch): checklist.append(OptCheck('DEBUG_NOTIFIERS', 'y', 'kspp', 'self_protection')) page_poisoning_is_set = OptCheck('PAGE_POISONING', 'y', 'kspp', 'self_protection') checklist.append(page_poisoning_is_set) + hardened_usercopy_is_set = OptCheck('HARDENED_USERCOPY', 'y', 'kspp', 'self_protection') + checklist.append(hardened_usercopy_is_set) + checklist.append(AND(OptCheck('HARDENED_USERCOPY_FALLBACK', 'is not set', 'kspp', 'self_protection'), \ + hardened_usercopy_is_set)) checklist.append(OR(OptCheck('MODULE_SIG', 'y', 'kspp', 'self_protection'), \ modules_not_set)) checklist.append(OR(OptCheck('MODULE_SIG_ALL', 'y', 'kspp', 'self_protection'), \ -- 2.31.1