From 7ed482ba8c3e8c9dd42691f779756772675a3dd8 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Fri, 21 Jan 2022 18:45:54 +0300 Subject: [PATCH] Fix TRIM_UNUSED_KSYMS check TRIM_UNUSED_KSYMS can't be enabled if MODULES are disabled. Thanks to @Churam for reporting. Refers to #58. --- kconfig_hardened_check/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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')] -- 2.31.1