|
@@ -421,6 +421,16 @@ static inline bool pti_kernel_image_global_ok(void)
|
|
if (boot_cpu_has(X86_FEATURE_K8))
|
|
if (boot_cpu_has(X86_FEATURE_K8))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * RANDSTRUCT derives its hardening benefits from the
|
|
|
|
+ * attacker's lack of knowledge about the layout of kernel
|
|
|
|
+ * data structures. Keep the kernel image non-global in
|
|
|
|
+ * cases where RANDSTRUCT is in use to help keep the layout a
|
|
|
|
+ * secret.
|
|
|
|
+ */
|
|
|
|
+ if (IS_ENABLED(CONFIG_GCC_PLUGIN_RANDSTRUCT))
|
|
|
|
+ return false;
|
|
|
|
+
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|