X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=kconfig_hardened_check%2F__init__.py;h=28ab04e105d342f201f51a2986619e739460f8b4;hb=4c4f25270de55449874e018879652d2fd4668663;hp=8f261499d7e2f5529e91c5f0be1d5c5d7f4d5221;hpb=fbaf5df462dd9e5efa6325158c47f415b38b10b5;p=kconfig-hardened-check.git diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 8f26149..28ab04e 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -11,14 +11,15 @@ # # # N.B Hardening command line parameters: -# slub_debug=FZP # slab_nomerge # page_alloc.shuffle=1 # iommu=force (does it help against DMA attacks?) +# slub_debug=FZ (slow) # page_poison=1 (if enabled) # init_on_alloc=1 # init_on_free=1 # loadpin.enforce=1 +# debugfs=no-mount (or off if possible) # # Mitigations of CPU vulnerabilities: # Аrch-independent: @@ -321,7 +322,10 @@ def construct_checklist(l, arch): 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' @@ -399,13 +403,12 @@ def construct_checklist(l, arch): l += [AND(OptCheck('self_protection', 'my', 'UBSAN_BOUNDS', 'y'), OptCheck('self_protection', 'my', 'UBSAN_MISC', 'is not set'), OptCheck('self_protection', 'my', 'UBSAN_TRAP', 'y'))] - l += [OptCheck('self_protection', 'my', 'SLUB_DEBUG_ON', 'y')] # TODO: is it better to set that via kernel cmd? l += [OptCheck('self_protection', 'my', 'RESET_ATTACK_MITIGATION', 'y')] # needs userspace support (systemd) if arch == 'X86_64': 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 # 'security_policy' if arch in ('X86_64', 'ARM64', 'X86_32'): @@ -525,6 +528,8 @@ def construct_checklist(l, arch): l += [OptCheck('userspace_hardening', 'defconfig', 'INTEGRITY', 'y')] if arch == 'ARM': l += [OptCheck('userspace_hardening', 'my', 'INTEGRITY', 'y')] + if arch == 'ARM64': + l += [OptCheck('userspace_hardening', 'defconfig', 'ARM64_MTE', 'y')] if arch in ('ARM', 'X86_32'): l += [OptCheck('userspace_hardening', 'defconfig', 'VMSPLIT_3G', 'y')] if arch in ('X86_64', 'ARM64'):