diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-21 12:36:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-21 12:36:28 -0400 |
commit | 56c631f5aec35117b0b5862a09a447a72dfbd678 (patch) | |
tree | dd8cd4fd783d1ce5a9f95a66c242e986d29c882a /scripts | |
parent | 56c1e8343494f0a315c99964ea1a952478394a8d (diff) | |
parent | 60f2c82ed20bde57c362e66f796cf9e0e38a6dbb (diff) |
Merge tag 'gcc-plugins-v5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull gcc-plugins fix from Kees Cook:
"Fix a potential problem in randomize_layout structure auto-selection
(that was not triggered by any existing kernel structures)"
* tag 'gcc-plugins-v5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
randstruct: Check member structs in is_pure_ops_struct()
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/gcc-plugins/randomize_layout_plugin.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index 6d5bbd31db7f..bd29e4e7a524 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c | |||
@@ -443,13 +443,13 @@ static int is_pure_ops_struct(const_tree node) | |||
443 | if (node == fieldtype) | 443 | if (node == fieldtype) |
444 | continue; | 444 | continue; |
445 | 445 | ||
446 | if (!is_fptr(fieldtype)) | 446 | if (code == RECORD_TYPE || code == UNION_TYPE) { |
447 | return 0; | 447 | if (!is_pure_ops_struct(fieldtype)) |
448 | 448 | return 0; | |
449 | if (code != RECORD_TYPE && code != UNION_TYPE) | ||
450 | continue; | 449 | continue; |
450 | } | ||
451 | 451 | ||
452 | if (!is_pure_ops_struct(fieldtype)) | 452 | if (!is_fptr(fieldtype)) |
453 | return 0; | 453 | return 0; |
454 | } | 454 | } |
455 | 455 | ||