From: Eneas U de Queiroz Date: Mon, 8 Apr 2024 21:09:56 +0000 (-0300) Subject: skip kernel.modules_disabled if MODULES not set X-Git-Tag: v0.6.10~73^2~5 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=7a85a7fddae52572d2cc3f51b7d2f1696b69b94a;p=kconfig-hardened-check.git skip kernel.modules_disabled if MODULES not set Signed-off-by: Eneas U de Queiroz --- diff --git a/kernel_hardening_checker/checks.py b/kernel_hardening_checker/checks.py index e2cf42e..4b5dee6 100644 --- a/kernel_hardening_checker/checks.py +++ b/kernel_hardening_checker/checks.py @@ -688,7 +688,9 @@ def add_sysctl_checks(l, _arch): # At first, it disabled unprivileged userfaultfd, # and since v5.11 it enables unprivileged userfaultfd for user-mode only. - l += [SysctlCheck('cut_attack_surface', 'clipos', 'kernel.modules_disabled', '1')] # radical, but may be useful in some cases + l += [OR(SysctlCheck('cut_attack_surface', 'clipos', 'kernel.modules_disabled', '1'), # radical, but may be useful in some cases + AND(KconfigCheck('cut_attack_surface', 'kspp', 'MODULES', 'is not set'), + have_config_file))] l += [SysctlCheck('harden_userspace', 'kspp', 'fs.protected_symlinks', '1')] l += [SysctlCheck('harden_userspace', 'kspp', 'fs.protected_hardlinks', '1')]