if arch == 'ARM':
l += [OptCheck('self_protection', 'defconfig', 'CPU_SW_DOMAIN_PAN', 'y')]
l += [OptCheck('self_protection', 'defconfig', 'STACKPROTECTOR_PER_TASK', 'y')]
if arch == 'ARM':
l += [OptCheck('self_protection', 'defconfig', 'CPU_SW_DOMAIN_PAN', 'y')]
l += [OptCheck('self_protection', 'defconfig', 'STACKPROTECTOR_PER_TASK', 'y')]
- if arch in ('ARM64', 'ARM'):
+ if arch == 'ARM64':
+ l += [OR(OptCheck('self_protection', 'defconfig', 'HARDEN_BRANCH_PREDICTOR', 'y'),
+ VerCheck((5, 10)))] # HARDEN_BRANCH_PREDICTOR is enabled by default since v5.10
+ if arch == 'ARM':
l += [OptCheck('self_protection', 'defconfig', 'HARDEN_BRANCH_PREDICTOR', 'y')]
# 'self_protection', 'kspp'
l += [OptCheck('self_protection', 'defconfig', 'HARDEN_BRANCH_PREDICTOR', 'y')]
# 'self_protection', 'kspp'
modules_not_set)]
l += [OR(OptCheck('self_protection', 'kspp', 'MODULE_SIG_FORCE', 'y'),
modules_not_set)] # refers to LOCKDOWN
modules_not_set)]
l += [OR(OptCheck('self_protection', 'kspp', 'MODULE_SIG_FORCE', 'y'),
modules_not_set)] # refers to LOCKDOWN
- l += [OR(OptCheck('self_protection', 'kspp', 'INIT_STACK_ALL', 'y'),
+ l += [OR(OptCheck('self_protection', 'kspp', 'INIT_STACK_ALL_ZERO', 'y'),
OptCheck('self_protection', 'kspp', 'GCC_PLUGIN_STRUCTLEAK_BYREF_ALL', 'y'))]
l += [OR(OptCheck('self_protection', 'kspp', 'INIT_ON_FREE_DEFAULT_ON', 'y'),
OptCheck('self_protection', 'kspp', 'PAGE_POISONING_ZERO', 'y'))] # before v5.3
OptCheck('self_protection', 'kspp', 'GCC_PLUGIN_STRUCTLEAK_BYREF_ALL', 'y'))]
l += [OR(OptCheck('self_protection', 'kspp', 'INIT_ON_FREE_DEFAULT_ON', 'y'),
OptCheck('self_protection', 'kspp', 'PAGE_POISONING_ZERO', 'y'))] # before v5.3
if arch == 'X86_64':
l += [AND(OptCheck('self_protection', 'my', 'AMD_IOMMU_V2', 'y'),
iommu_support_is_set)]
if arch == 'X86_64':
l += [AND(OptCheck('self_protection', 'my', 'AMD_IOMMU_V2', 'y'),
iommu_support_is_set)]
l += [OptCheck('userspace_hardening', 'defconfig', 'INTEGRITY', 'y')]
if arch == 'ARM':
l += [OptCheck('userspace_hardening', 'my', 'INTEGRITY', 'y')]
l += [OptCheck('userspace_hardening', 'defconfig', 'INTEGRITY', 'y')]
if arch == 'ARM':
l += [OptCheck('userspace_hardening', 'my', 'INTEGRITY', 'y')]
if arch in ('ARM', 'X86_32'):
l += [OptCheck('userspace_hardening', 'defconfig', 'VMSPLIT_3G', 'y')]
if arch in ('X86_64', 'ARM64'):
if arch in ('ARM', 'X86_32'):
l += [OptCheck('userspace_hardening', 'defconfig', 'VMSPLIT_3G', 'y')]
if arch in ('X86_64', 'ARM64'):
- if hasattr(opt, 'opts'):
- # prepare ComplexOptCheck
- for o in opt.opts:
- if hasattr(o, 'opts'):
- # Recursion for nested ComplexOptChecks
- perform_check(o, parsed_options, kernel_version)
- if hasattr(o, 'state'):
- o.state = parsed_options.get(o.name, None)
- if hasattr(o, 'ver'):
- o.ver = kernel_version
- else:
- # prepare simple check, opt.state is mandatory
- if not hasattr(opt, 'state'):
- sys.exit('[!] ERROR: bad simple check {}'.format(vars(opt)))
- opt.state = parsed_options.get(opt.name, None)
- opt.check()
+ if hasattr(opt, 'opts'):
+ # prepare ComplexOptCheck
+ for o in opt.opts:
+ if hasattr(o, 'opts'):
+ # Recursion for nested ComplexOptChecks
+ perform_check(o, parsed_options, kernel_version)
+ if hasattr(o, 'state'):
+ o.state = parsed_options.get(o.name, None)
+ if hasattr(o, 'ver'):
+ o.ver = kernel_version
+ else:
+ # prepare simple check, opt.state is mandatory
+ if not hasattr(opt, 'state'):
+ sys.exit('[!] ERROR: bad simple check {}'.format(vars(opt)))
+ opt.state = parsed_options.get(opt.name, None)
+ opt.check()