diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2021-12-23 00:10:03 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-12-29 04:20:31 +0100 |
commit | 5b3d72987701d51bf31823b39db49d10970f5c2d (patch) | |
tree | 02e2914a801f88f5ebfa97c884057856e97ec2e1 /net/kcm/kcmsock.c | |
parent | libbpf: Use 100-character limit to make bpf_tracing.h easier to read (diff) | |
download | linux-5b3d72987701d51bf31823b39db49d10970f5c2d.tar.xz linux-5b3d72987701d51bf31823b39db49d10970f5c2d.zip |
libbpf: Improve LINUX_VERSION_CODE detection
Ubuntu reports incorrect kernel version through uname(), which on older
kernels leads to kprobe BPF programs failing to load due to the version
check mismatch.
Accommodate Ubuntu's quirks with LINUX_VERSION_CODE by using
Ubuntu-specific /proc/version_code to fetch major/minor/patch versions
to form LINUX_VERSION_CODE.
While at it, consolide libbpf's kernel version detection code between
libbpf.c and libbpf_probes.c.
[0] Closes: https://github.com/libbpf/libbpf/issues/421
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20211222231003.2334940-1-andrii@kernel.org
Diffstat (limited to 'net/kcm/kcmsock.c')
0 files changed, 0 insertions, 0 deletions