Add CFI_CLANG
[kconfig-hardened-check.git] / kconfig_hardened_check / __init__.py
index 362a6e4dd4ac9408bd9b404211821be86c8e601d..c69380c19cd35ef91f4d4f43571a6640dc0aa719 100644 (file)
@@ -325,6 +325,7 @@ def construct_checklist(l, arch):
                   iommu_support_is_set)]
     if arch == 'ARM64':
         l += [OptCheck('self_protection', 'defconfig', 'ARM64_PAN', 'y')]
+        l += [OptCheck('self_protection', 'defconfig', 'ARM64_EPAN', 'y')]
         l += [OptCheck('self_protection', 'defconfig', 'UNMAP_KERNEL_AT_EL0', 'y')]
         l += [OR(OptCheck('self_protection', 'defconfig', 'HARDEN_EL2_VECTORS', 'y'),
                  AND(OptCheck('self_protection', 'defconfig', 'RANDOMIZE_BASE', 'y'),
@@ -427,6 +428,10 @@ def construct_checklist(l, arch):
     if arch == 'ARM64':
         l += [OptCheck('self_protection', 'my', 'SHADOW_CALL_STACK', 'y')] # depends on clang, maybe it's alternative to STACKPROTECTOR_STRONG
         l += [OptCheck('self_protection', 'my', 'KASAN_HW_TAGS', 'y')]
+        cfi_clang_is_set = OptCheck('self_protection', 'my', 'CFI_CLANG', 'y')
+        l += [cfi_clang_is_set]
+        l += [AND(OptCheck('self_protection', 'my', 'CFI_PERMISSIVE', 'is not set'),
+                  cfi_clang_is_set)]
 
     # 'security_policy'
     if arch in ('X86_64', 'ARM64', 'X86_32'):