Files
kernel_xiaomi_raphael/include/net
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
2019-05-08 07:20:45 +02:00
2019-03-23 14:35:16 +01:00
2019-12-05 15:38:18 +01:00
2019-02-23 09:06:44 +01:00
2019-07-19 16:24:39 +08:00
2017-08-31 14:42:19 -07:00
2020-01-04 19:09:37 +01:00
2019-11-10 11:25:37 +01:00
2019-03-13 14:03:09 -07:00
2019-11-20 17:59:59 +01:00
2020-03-05 12:59:36 -05:00
2016-10-03 02:00:22 -04:00
2018-05-16 10:10:23 +02:00
2018-02-25 11:07:59 +01:00
2019-09-16 09:41:58 +02:00