aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/Kconfig12
-rw-r--r--scripts/gcc-plugins/randomize_layout_plugin.c3
2 files changed, 7 insertions, 8 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 21d0089117fe..4ada3209146a 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -473,11 +473,13 @@ config GCC_PLUGIN_RANDSTRUCT
473 depends on GCC_PLUGINS 473 depends on GCC_PLUGINS
474 select MODVERSIONS if MODULES 474 select MODVERSIONS if MODULES
475 help 475 help
476 If you say Y here, the layouts of structures explicitly 476 If you say Y here, the layouts of structures that are entirely
477 marked by __randomize_layout will be randomized at 477 function pointers (and have not been manually annotated with
478 compile-time. This can introduce the requirement of an 478 __no_randomize_layout), or structures that have been explicitly
479 additional information exposure vulnerability for exploits 479 marked with __randomize_layout, will be randomized at compile-time.
480 targeting these structure types. 480 This can introduce the requirement of an additional information
481 exposure vulnerability for exploits targeting these structure
482 types.
481 483
482 Enabling this feature will introduce some performance impact, 484 Enabling this feature will introduce some performance impact,
483 slightly increase memory usage, and prevent the use of forensic 485 slightly increase memory usage, and prevent the use of forensic
diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c
index cdaac8c66734..0073af326449 100644
--- a/scripts/gcc-plugins/randomize_layout_plugin.c
+++ b/scripts/gcc-plugins/randomize_layout_plugin.c
@@ -436,9 +436,6 @@ static int is_pure_ops_struct(const_tree node)
436 436
437 gcc_assert(TREE_CODE(node) == RECORD_TYPE || TREE_CODE(node) == UNION_TYPE); 437 gcc_assert(TREE_CODE(node) == RECORD_TYPE || TREE_CODE(node) == UNION_TYPE);
438 438
439 /* XXX: Do not apply randomization to all-ftpr structs yet. */
440 return 0;
441
442 for (field = TYPE_FIELDS(node); field; field = TREE_CHAIN(field)) { 439 for (field = TYPE_FIELDS(node); field; field = TREE_CHAIN(field)) {
443 const_tree fieldtype = get_field_type(field); 440 const_tree fieldtype = get_field_type(field);
444 enum tree_code code = TREE_CODE(fieldtype); 441 enum tree_code code = TREE_CODE(fieldtype);