Merge branch 'from-martin-rowe'
authorAlexander Popov <alex.popov@linux.com>
Fri, 8 Apr 2022 16:45:37 +0000 (19:45 +0300)
committerAlexander Popov <alex.popov@linux.com>
Fri, 8 Apr 2022 16:45:37 +0000 (19:45 +0300)
kconfig_hardened_check/__init__.py

index 793e7d31be6137ca90d825b2bd74fa7fb6f1ed2d..9400d26c59d5e18bdd5adebc9c6fab77190c1606 100644 (file)
@@ -430,8 +430,9 @@ def add_kconfig_checks(l, arch):
     # 'self_protection', 'maintainer'
     ubsan_bounds_is_set = KconfigCheck('self_protection', 'maintainer', 'UBSAN_BOUNDS', 'y') # only array index bounds checking
     l += [ubsan_bounds_is_set] # recommended by Kees Cook in /issues/53
-    l += [AND(KconfigCheck('self_protection', 'maintainer', 'UBSAN_SANITIZE_ALL', 'y'),
-              ubsan_bounds_is_set)] # recommended by Kees Cook in /issues/53
+    if arch in ('X86_64', 'ARM64', 'X86_32'):  # ARCH_HAS_UBSAN_SANITIZE_ALL is not enabled for ARM
+        l += [AND(KconfigCheck('self_protection', 'maintainer', 'UBSAN_SANITIZE_ALL', 'y'),
+                  ubsan_bounds_is_set)] # recommended by Kees Cook in /issues/53
     l += [AND(KconfigCheck('self_protection', 'maintainer', 'UBSAN_TRAP', 'y'),
               ubsan_bounds_is_set)] # recommended by Kees Cook in /issues/53