mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
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>
This commit is contained in:
parent
3598f5d087
commit
9225331b31
2 changed files with 7 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue