From: Alexander Popov Date: Fri, 21 Jan 2022 15:45:54 +0000 (+0300) Subject: Fix TRIM_UNUSED_KSYMS check X-Git-Tag: v0.5.17~32 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;ds=inline;h=7ed482ba8c3e8c9dd42691f779756772675a3dd8;p=kconfig-hardened-check.git Fix TRIM_UNUSED_KSYMS check TRIM_UNUSED_KSYMS can't be enabled if MODULES are disabled. Thanks to @Churam for reporting. Refers to #58. --- diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index ce93310..1132d26 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -571,7 +571,8 @@ def construct_checklist(l, arch): l += [OptCheck('cut_attack_surface', 'lockdown', 'KPROBES', 'is not set')] # refers to LOCKDOWN # 'cut_attack_surface', 'my' - l += [OptCheck('cut_attack_surface', 'my', 'TRIM_UNUSED_KSYMS', 'y')] + l += [OR(OptCheck('cut_attack_surface', 'my', 'TRIM_UNUSED_KSYMS', 'y'), + modules_not_set)] l += [OptCheck('cut_attack_surface', 'my', 'MMIOTRACE', 'is not set')] # refers to LOCKDOWN (permissive) l += [OptCheck('cut_attack_surface', 'my', 'LIVEPATCH', 'is not set')] l += [OptCheck('cut_attack_surface', 'my', 'IP_DCCP', 'is not set')]