Skip to content

Commit

Permalink
Add the new names of RETPOLINE, CPU_SRSO, SLS
Browse files Browse the repository at this point in the history
Since Linux v6.9 they are renamed:
  RETPOLINE -> MITIGATION_RETPOLINE
  CPU_SRSO -> MITIGATION_SRSO
  SLS -> MITIGATION_SLS

Refers to #127, #117
  • Loading branch information
a13xp0p0v committed Jun 2, 2024
1 parent 9d1c4cf commit 86b67f3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions kernel_hardening_checker/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def add_kconfig_checks(l: List[ChecklistObjType], arch: str) -> None:
l += [KconfigCheck('self_protection', 'defconfig', 'DEBUG_WX', 'y')]
l += [KconfigCheck('self_protection', 'defconfig', 'WERROR', 'y')]
l += [KconfigCheck('self_protection', 'defconfig', 'X86_MCE', 'y')]
l += [KconfigCheck('self_protection', 'defconfig', 'RETPOLINE', 'y')]
l += [KconfigCheck('self_protection', 'defconfig', 'SYN_COOKIES', 'y')] # another reason?
microcode_is_set = KconfigCheck('self_protection', 'defconfig', 'MICROCODE', 'y')
l += [microcode_is_set] # is needed for mitigating CPU bugs
Expand All @@ -89,6 +88,8 @@ def add_kconfig_checks(l: List[ChecklistObjType], arch: str) -> None:
cpu_sup_intel_not_set)]
l += [OR(KconfigCheck('self_protection', 'defconfig', 'X86_MCE_AMD', 'y'),
cpu_sup_amd_not_set)]
l += [OR(KconfigCheck('self_protection', 'defconfig', 'MITIGATION_RETPOLINE', 'y'),
KconfigCheck('self_protection', 'defconfig', 'RETPOLINE', 'y'))]
if arch in ('ARM64', 'ARM'):
l += [KconfigCheck('self_protection', 'defconfig', 'HW_RANDOM_TPM', 'y')]
l += [KconfigCheck('self_protection', 'defconfig', 'IOMMU_DEFAULT_DMA_STRICT', 'y')]
Expand All @@ -99,7 +100,8 @@ def add_kconfig_checks(l: List[ChecklistObjType], arch: str) -> None:
l += [KconfigCheck('self_protection', 'defconfig', 'X86_KERNEL_IBT', 'y')]
l += [OR(KconfigCheck('self_protection', 'defconfig', 'MITIGATION_PAGE_TABLE_ISOLATION', 'y'),
KconfigCheck('self_protection', 'defconfig', 'PAGE_TABLE_ISOLATION', 'y'))]
l += [OR(KconfigCheck('self_protection', 'defconfig', 'CPU_SRSO', 'y'),
l += [OR(KconfigCheck('self_protection', 'defconfig', 'MITIGATION_SRSO', 'y'),
KconfigCheck('self_protection', 'defconfig', 'CPU_SRSO', 'y'),
cpu_sup_amd_not_set)]
l += [AND(KconfigCheck('self_protection', 'defconfig', 'INTEL_IOMMU', 'y'),
iommu_support_is_set)]
Expand Down Expand Up @@ -235,7 +237,8 @@ def add_kconfig_checks(l: List[ChecklistObjType], arch: str) -> None:
l += [KconfigCheck('self_protection', 'kspp', 'DEFAULT_MMAP_MIN_ADDR', '32768')]
l += [KconfigCheck('self_protection', 'kspp', 'SYN_COOKIES', 'y')] # another reason?
if arch == 'X86_64':
l += [KconfigCheck('self_protection', 'kspp', 'SLS', 'y')] # vs CVE-2021-26341 in Straight-Line-Speculation
l += [OR(KconfigCheck('self_protection', 'kspp', 'MITIGATION_SLS', 'y'),
KconfigCheck('self_protection', 'kspp', 'SLS', 'y'))] # vs CVE-2021-26341 in Straight-Line-Speculation
l += [AND(KconfigCheck('self_protection', 'kspp', 'INTEL_IOMMU_SVM', 'y'),
iommu_support_is_set)]
l += [AND(KconfigCheck('self_protection', 'kspp', 'AMD_IOMMU_V2', 'y'),
Expand Down

0 comments on commit 86b67f3

Please sign in to comment.