diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2019-04-24 00:45:56 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-04-25 13:47:29 -0700 |
commit | 8837fe5dd09bd0331b3e2d1b6e400b7fcda8963a (patch) | |
tree | 7582c3fbf5373b27befd235747ac44a58d083514 /.cocciconfig | |
parent | a21b48a2f2afa53bbc989cce6fc81edbed39eab0 (diff) | |
download | linux-8837fe5dd09bd0331b3e2d1b6e400b7fcda8963a.tar.bz2 |
bpf, libbpf: handle old kernels more graceful wrt global data sections
Andrii reported a corner case where e.g. global static data is present
in the BPF ELF file in form of .data/.bss/.rodata section, but without
any relocations to it. Such programs could be loaded before commit
d859900c4c56 ("bpf, libbpf: support global data/bss/rodata sections"),
whereas afterwards if kernel lacks support then loading would fail.
Add a probing mechanism which skips setting up libbpf internal maps
in case of missing kernel support. In presence of relocation entries,
we abort the load attempt.
Fixes: d859900c4c56 ("bpf, libbpf: support global data/bss/rodata sections")
Reported-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to '.cocciconfig')
0 files changed, 0 insertions, 0 deletions