From: Eneas U de Queiroz Date: Wed, 6 Sep 2023 17:20:53 +0000 (-0300) Subject: Skip unprivileged_bpf_disabled if BPF_SYSCALL not set X-Git-Tag: v0.6.10~73^2~8 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=01617bdd2b47d4e75894ae6e2061334ac1868798;p=kconfig-hardened-check.git Skip unprivileged_bpf_disabled if BPF_SYSCALL not set Signed-off-by: Eneas U de Queiroz --- diff --git a/kernel_hardening_checker/checks.py b/kernel_hardening_checker/checks.py index fa5c08a..9f48d58 100644 --- a/kernel_hardening_checker/checks.py +++ b/kernel_hardening_checker/checks.py @@ -676,7 +676,9 @@ def add_sysctl_checks(l, _arch): have_config_file))] l += [SysctlCheck('cut_attack_surface', 'kspp', 'user.max_user_namespaces', '0')] # may break the upower daemon in Ubuntu l += [SysctlCheck('cut_attack_surface', 'kspp', 'dev.tty.ldisc_autoload', '0')] - l += [SysctlCheck('cut_attack_surface', 'kspp', 'kernel.unprivileged_bpf_disabled', '1')] + l += [OR(SysctlCheck('cut_attack_surface', 'kspp', 'kernel.unprivileged_bpf_disabled', '1'), + AND(KconfigCheck('cut_attack_surface', 'lockdown', 'BPF_SYSCALL', 'is not set'), + have_config_file))] l += [SysctlCheck('cut_attack_surface', 'kspp', 'kernel.kptr_restrict', '2')] l += [SysctlCheck('cut_attack_surface', 'kspp', 'dev.tty.legacy_tiocsti', '0')] l += [SysctlCheck('cut_attack_surface', 'kspp', 'vm.unprivileged_userfaultfd', '0')]