Commit 5fbc06fa by Alexander Popov

Add cmdline checks to '--print'

parent b9e670c3
...@@ -656,6 +656,14 @@ def add_kconfig_checks(l, arch): ...@@ -656,6 +656,14 @@ def add_kconfig_checks(l, arch):
# l += [KconfigCheck('feature_test', 'my', 'LKDTM', 'm')] # only for debugging! # l += [KconfigCheck('feature_test', 'my', 'LKDTM', 'm')] # only for debugging!
def add_cmdline_checks(l, arch):
# Calling the CmdlineCheck class constructor:
# CmdlineCheck(reason, decision, name, expected)
l += [CmdlineCheck('self_protection', 'kspp', 'randomize_kstack_offset', 'on')]
# TODO: add other
def print_unknown_options(checklist, parsed_options): def print_unknown_options(checklist, parsed_options):
known_options = [] known_options = []
...@@ -861,6 +869,7 @@ def main(): ...@@ -861,6 +869,7 @@ def main():
sys.exit('[!] ERROR: wrong mode "{}" for --print'.format(mode)) sys.exit('[!] ERROR: wrong mode "{}" for --print'.format(mode))
arch = args.print arch = args.print
add_kconfig_checks(config_checklist, arch) add_kconfig_checks(config_checklist, arch)
add_cmdline_checks(config_checklist, arch)
if mode != 'json': if mode != 'json':
print('[+] Printing kernel security hardening preferences for {}...'.format(arch)) print('[+] Printing kernel security hardening preferences for {}...'.format(arch))
print_checklist(mode, config_checklist, False) print_checklist(mode, config_checklist, False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment