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'
l += [AND(OptCheck('self_protection', 'my', 'AMD_IOMMU_V2', 'y'),
iommu_support_is_set)]
if arch == 'ARM64':
l += [AND(OptCheck('self_protection', 'my', 'AMD_IOMMU_V2', 'y'),
iommu_support_is_set)]
if arch == 'ARM64':
- l += [OptCheck('self_protection', 'my', 'SHADOW_CALL_STACK', 'y')]
+ l += [OptCheck('self_protection', 'my', 'SHADOW_CALL_STACK', 'y')] # maybe it should be alternative to STACKPROTECTOR_STRONG
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()