X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=kernel_hardening_checker%2Fchecks.py;h=193b374c8ae444628fec525e071134367b5228cb;hb=32db0791105d82fd5703b90385b8ef10c4225fb5;hp=fa664e04861f31a4e655842d76bf71495cd9c6ae;hpb=cd187825381ecd32724454e561cd419cfe64f7f8;p=kconfig-hardened-check.git diff --git a/kernel_hardening_checker/checks.py b/kernel_hardening_checker/checks.py index fa664e0..193b374 100644 --- a/kernel_hardening_checker/checks.py +++ b/kernel_hardening_checker/checks.py @@ -14,7 +14,7 @@ This module contains knowledge for checks. from .engine import KconfigCheck, CmdlineCheck, SysctlCheck, VersionCheck, OR, AND -def add_kconfig_checks(l, arch): +def add_kconfig_checks(l, arch: str): assert(arch), 'empty arch' # Calling the KconfigCheck class constructor: @@ -422,7 +422,7 @@ def add_kconfig_checks(l, arch): l += [KconfigCheck('harden_userspace', 'a13xp0p0v', 'X86_USER_SHADOW_STACK', 'y')] -def add_cmdline_checks(l, arch): +def add_cmdline_checks(l, arch: str): assert(arch), 'empty arch' # Calling the CmdlineCheck class constructor: @@ -630,7 +630,7 @@ no_kstrtobool_options = [ ] -def normalize_cmdline_options(option, value): +def normalize_cmdline_options(option: str, value: str) -> str: # Don't normalize the cmdline option values if # the Linux kernel doesn't use kstrtobool() for them if option in no_kstrtobool_options: @@ -657,7 +657,7 @@ def normalize_cmdline_options(option, value): # kernel.warn_limit (think about a proper value) # net.ipv4.tcp_syncookies=1 (?) -def add_sysctl_checks(l, _arch): +def add_sysctl_checks(l, _arch: str): # This function may be called with arch=None # Calling the SysctlCheck class constructor: