diff options
| author | Jerome Brunet <jbrunet@baylibre.com> | 2024-07-29 16:32:02 +0200 |
|---|---|---|
| committer | Jerome Brunet <jbrunet@baylibre.com> | 2024-07-29 16:32:02 +0200 |
| commit | 66e72a01b60ae6950ddbb3585fdc1424d303e14b (patch) | |
| tree | 05789274ef25cb5d08b99d1797e7760047469685 /include/linux/fortify-string.h | |
| parent | 3d0e8b6edd6b08f72e07e1230f371f6ca93531e4 (diff) | |
| parent | 8400291e289ee6b2bf9779ff1c83a291501f017b (diff) | |
Merge tag 'v6.11-rc1' into clk-meson-next
Linux 6.11-rc1
Diffstat (limited to 'include/linux/fortify-string.h')
| -rw-r--r-- | include/linux/fortify-string.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/linux/fortify-string.h b/include/linux/fortify-string.h index 7e0f340bf363..0d99bf11d260 100644 --- a/include/linux/fortify-string.h +++ b/include/linux/fortify-string.h @@ -601,11 +601,7 @@ __FORTIFY_INLINE bool fortify_memcpy_chk(__kernel_size_t size, /* * Warn when writing beyond destination field size. * - * We must ignore p_size_field == 0 for existing 0-element - * fake flexible arrays, until they are all converted to - * proper flexible arrays. - * - * The implementation of __builtin_*object_size() behaves + * Note the implementation of __builtin_*object_size() behaves * like sizeof() when not directly referencing a flexible * array member, which means there will be many bounds checks * that will appear at run-time, without a way for them to be @@ -613,7 +609,7 @@ __FORTIFY_INLINE bool fortify_memcpy_chk(__kernel_size_t size, * is specifically the flexible array member). * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101832 */ - if (p_size_field != 0 && p_size_field != SIZE_MAX && + if (p_size_field != SIZE_MAX && p_size != p_size_field && p_size_field < size) return true; |
