diff options
author | Kees Cook <keescook@chromium.org> | 2017-05-05 23:56:07 -0700 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-08-01 17:04:48 -0700 |
commit | 9225331b310821760f39ba55b00b8973602adbb5 (patch) | |
tree | 486443275c8d05ebe69d6d403ccf0b8fe5296425 /scripts/gcc-plugins | |
parent | 3598f5d0872ff574c5b6704024f12ca4a3056860 (diff) |
randstruct: Enable function pointer struct detection
This enables the automatic structure selection logic in the randstruct
GCC plugin. The selection logic randomizes all structures that contain
only function pointers, unless marked with __no_randomize_layout.
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'scripts/gcc-plugins')
-rw-r--r-- | scripts/gcc-plugins/randomize_layout_plugin.c | 3 |
1 files changed, 0 insertions, 3 deletions
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) gcc_assert(TREE_CODE(node) == RECORD_TYPE || TREE_CODE(node) == UNION_TYPE); - /* XXX: Do not apply randomization to all-ftpr structs yet. */ - return 0; - for (field = TYPE_FIELDS(node); field; field = TREE_CHAIN(field)) { const_tree fieldtype = get_field_type(field); enum tree_code code = TREE_CODE(fieldtype); |