diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2023-11-26 00:49:12 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-13 20:45:35 +0300 |
commit | b79210fa10db4cab09b19965f6cc47bc393e47e9 (patch) | |
tree | 710a1bfab72da5cb87aaa5d02c12535f939c876d /scripts | |
parent | ba6e4b997181497e51419fad2b73d229bffa1787 (diff) | |
download | linux-b79210fa10db4cab09b19965f6cc47bc393e47e9.tar.xz |
gcc-plugins: randstruct: Update code comment in relayout_struct()
commit d71f22365a9caca82d424f3a33445de46567e198 upstream.
Update code comment to clarify that the only element whose layout is
not randomized is a proper C99 flexible-array member. This update is
complementary to commit 1ee60356c2dc ("gcc-plugins: randstruct: Only
warn about true flexible arrays")
Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/ZWJr2MWDjXLHE8ap@work
Fixes: 1ee60356c2dc ("gcc-plugins: randstruct: Only warn about true flexible arrays")
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/gcc-plugins/randomize_layout_plugin.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index 910bd21d08f4..746ff2d272f2 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c @@ -339,8 +339,7 @@ static int relayout_struct(tree type) /* * enforce that we don't randomize the layout of the last - * element of a struct if it's a 0 or 1-length array - * or a proper flexible array + * element of a struct if it's a proper flexible array */ if (is_flexible_array(newtree[num_fields - 1])) { has_flexarray = true; |