Files
linux-stable-mirror/include/uapi/linux
GONG, Ruiqi a7ed3465da netfilter: ebtables: fix fortify warnings in size_entry_mwt()
When compiling with gcc 13 and CONFIG_FORTIFY_SOURCE=y, the following
warning appears:

In function ‘fortify_memcpy_chk’,
    inlined from ‘size_entry_mwt’ at net/bridge/netfilter/ebtables.c:2118:2:
./include/linux/fortify-string.h:592:25: error: call to ‘__read_overflow2_field’
declared with attribute warning: detected read beyond size of field (2nd parameter);
maybe use struct_group()? [-Werror=attribute-warning]
  592 |                         __read_overflow2_field(q_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The compiler is complaining:

memcpy(&offsets[1], &entry->watchers_offset,
                       sizeof(offsets) - sizeof(offsets[0]));

where memcpy reads beyong &entry->watchers_offset to copy
{watchers,target,next}_offset altogether into offsets[]. Silence the
warning by wrapping these three up via struct_group().

Signed-off-by: GONG, Ruiqi <gongruiqi1@huawei.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
2023-08-22 15:13:20 +02:00
..
2023-05-14 16:05:28 +01:00
2023-05-30 15:20:08 +01:00
2023-04-22 14:41:30 -07:00
2023-01-20 09:33:22 +00:00
2023-03-06 15:49:07 -06:00
2023-03-16 21:20:32 -07:00
2023-06-07 16:26:33 +02:00
2023-06-28 16:09:41 -06:00
2023-03-23 17:25:46 +01:00
2023-06-09 16:25:16 -07:00
2023-05-19 04:30:22 +02:00
2023-04-27 19:15:11 -06:00
2023-07-28 09:33:12 -07:00
2023-01-26 10:52:18 +01:00
2023-06-05 09:36:35 +02:00
2023-03-23 17:25:46 +01:00
2023-06-09 16:13:01 +01:00
2023-06-09 16:14:40 +01:00
2022-12-05 10:30:47 +01:00