Arnd Bergmann
b60945b0aa
bpf: Avoid gcc-10 stringop-overflow warning in struct bpf_prog
...
gcc-10 warns about accesses to zero-length arrays:
kernel/bpf/core.c: In function 'bpf_patch_insn_single':
cc1: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]
In file included from kernel/bpf/core.c:21:
include/linux/filter.h:550:20: note: at offset 0 to object 'insnsi' with size 0 declared here
550 | struct bpf_insn insnsi[0];
| ^~~~~~
In this case, we really want to have two flexible-array members,
but that is not possible. Removing the union to make insnsi a
flexible-array member while leaving insns as a zero-length array
fixes the warning, as nothing writes to the other one in that way.
This trick only works on linux-3.18 or higher, as older versions
had additional members in the union.
Fixes: 60a3b22 ("net: bpf: make eBPF interpreter images read-only")
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Link: https://lore.kernel.org/bpf/20200430213101.135134-6-arnd@arndb.de
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com >
2020-06-23 12:43:13 +05:30
..
2017-07-11 06:08:58 -04:00
2020-06-23 12:43:13 +05:30
2019-05-08 07:20:45 +02:00
2017-11-02 11:10:55 +01:00
2020-06-14 13:43:25 +05:30
2020-05-21 09:48:37 +00:00
2019-05-16 19:42:32 +02:00
2019-03-23 14:35:16 +01:00
2019-12-05 15:38:18 +01:00
2019-05-04 09:15:20 +02:00
2017-04-12 22:02:36 +02:00
2020-06-03 08:17:33 +02:00
2020-05-20 12:15:34 +02:00
2017-08-29 10:55:20 +01:00
2017-11-02 11:10:55 +01:00
2019-08-04 09:31:59 +02:00
2017-11-02 11:10:55 +01:00
2019-06-11 12:21:51 +02:00
2017-11-02 11:10:55 +01:00
2019-02-23 09:06:44 +01:00
2017-05-27 18:51:41 -04:00
2019-11-12 19:17:46 +01:00
2019-11-10 11:25:24 +01:00
2017-07-04 22:35:16 +01:00
2020-06-14 13:43:25 +05:30
2017-01-20 12:12:13 -05:00
2017-07-04 01:29:04 -07:00
2020-02-18 12:33:31 -08:00
2020-03-06 03:03:32 -08:00
2018-09-13 16:15:44 -07:00
2020-02-06 03:21:34 -08:00
2019-07-19 16:24:39 +08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-31 14:42:19 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-05 11:53:34 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-01-04 14:00:14 +01:00
2020-01-04 19:09:37 +01:00
2017-08-22 14:29:30 -07:00
2017-11-02 11:10:55 +01:00
2017-09-01 20:33:42 -07:00
2020-03-20 10:54:10 +01:00
2017-11-02 11:10:55 +01:00
2020-03-11 18:02:48 +01:00
2018-09-04 17:54:26 -07:00
2017-11-02 11:10:55 +01:00
2019-11-10 11:25:37 +01:00
2019-11-10 11:25:37 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-03-13 14:03:09 -07:00
2017-01-25 16:00:33 +01:00
2017-07-04 01:29:04 -07:00
2018-04-29 11:33:13 +02:00
2017-01-18 13:04:28 -05:00
2017-08-07 11:39:22 -07:00
2017-11-02 11:10:55 +01:00
2020-05-26 12:11:43 +05:30
2017-11-02 11:10:55 +01:00
2019-04-27 09:35:40 +02:00
2020-01-04 14:00:19 +01:00
2018-10-22 07:08:27 -07:00
2018-05-16 10:10:24 +02:00
2019-02-23 09:06:42 +01:00
2019-06-11 12:21:47 +02:00
2020-04-24 08:00:53 +02:00
2019-07-21 09:04:28 +02:00
2019-01-31 08:13:42 +01:00
2017-11-02 11:10:55 +01:00
2019-11-12 19:18:38 +01:00
2020-04-17 17:59:15 +05:30
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-09-16 08:20:44 +02:00
2020-06-14 13:43:25 +05:30
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-02-06 17:31:33 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-11-06 12:43:36 +01:00
2019-11-20 17:59:59 +01:00
2017-11-02 11:10:55 +01:00
2018-05-30 07:51:58 +02:00
2020-03-05 12:59:36 -05:00
2017-11-02 11:10:55 +01:00
2017-04-01 20:21:44 -07:00
2016-10-03 02:00:22 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-03-28 11:08:32 +00:00
2020-05-15 16:04:08 +05:30
2019-04-17 08:37:50 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-07-01 07:39:09 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-05-16 10:10:23 +02:00
2017-08-29 15:16:52 -07:00
2017-11-02 11:10:55 +01:00
2017-11-09 10:03:09 +09:00
2017-11-06 11:37:20 -08:00
2017-11-02 11:10:55 +01:00
2017-10-01 03:55:47 +01:00
2019-09-10 10:32:21 +01:00
2017-11-02 11:10:55 +01:00
2017-08-07 11:39:21 -07:00
2017-11-02 11:10:55 +01:00
2018-02-25 11:07:59 +01:00
2018-05-30 07:52:01 +02:00
2020-01-27 14:46:50 +01:00
2017-08-21 12:24:07 -06:00
2017-11-02 11:10:55 +01:00
2018-05-30 07:52:14 +02:00
2017-11-02 11:10:55 +01:00
2020-05-26 12:11:43 +05:30
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-11-09 20:40:06 -05:00
2017-08-25 17:10:23 -07:00
2018-04-19 08:56:16 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-06-16 10:42:19 +05:30
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-25 10:37:11 +09:00
2017-08-07 14:48:48 -07:00
2020-06-14 21:40:28 +05:30
2018-12-05 19:41:10 +01:00
2018-06-26 08:06:28 +08:00
2017-11-02 11:10:55 +01:00
2017-08-29 15:16:52 -07:00
2018-11-16 14:44:16 -07:00
2019-06-13 15:12:32 -06:00
2018-03-08 22:41:10 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-09-16 09:41:58 +02:00