Go to file
Viktor Malik 903fad4394 tools/resolve_btfids: Fix cross-compilation to non-host endianness
The .BTF_ids section is pre-filled with zeroed BTF ID entries during the
build and afterwards patched by resolve_btfids with correct values.
Since resolve_btfids always writes in host-native endianness, it relies
on libelf to do the translation when the target ELF is cross-compiled to
a different endianness (this was introduced in commit 61e8aeda93
("bpf: Fix libelf endian handling in resolv_btfids")).

Unfortunately, the translation will corrupt the flags fields of SET8
entries because these were written during vmlinux compilation and are in
the correct endianness already. This will lead to numerous selftests
failures such as:

    $ sudo ./test_verifier 502 502
    #502/p sleepable fentry accept FAIL
    Failed to load prog 'Invalid argument'!
    bpf_fentry_test1 is not sleepable
    verification time 34 usec
    stack depth 0
    processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
    Summary: 0 PASSED, 0 SKIPPED, 1 FAILED

Since it's not possible to instruct libelf to translate just certain
values, let's manually bswap the flags (both global and entry flags) in
resolve_btfids when needed, so that libelf then translates everything
correctly.

Fixes: ef2c6f370a ("tools/resolve_btfids: Add support for 8-byte BTF sets")
Signed-off-by: Viktor Malik <vmalik@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/7b6bff690919555574ce0f13d2a5996cacf7bf69.1707223196.git.vmalik@redhat.com
2024-02-07 15:56:18 -08:00
arch riscv, bpf: Enable inline bpf_kptr_xchg() for RV64 2024-02-01 11:35:48 +01:00
block for-6.8/block-2024-01-18 2024-01-18 18:22:40 -08:00
certs
crypto crypto: scomp - fix req->dst buffer overflow 2023-12-29 11:25:56 +08:00
Documentation bpf, docs: Fix typos in instructions-set.rst 2024-02-06 07:44:59 -08:00
drivers bpf: treewide: Annotate BPF kfuncs in BTF 2024-01-31 20:40:56 -08:00
fs bpf: treewide: Annotate BPF kfuncs in BTF 2024-01-31 20:40:56 -08:00
include bpf: Preserve boundaries and track scalars on narrowing fill 2024-02-02 13:22:14 -08:00
init init: Kconfig: Disable -Wstringop-overflow for GCC-11 2024-01-21 17:45:31 -06:00
io_uring for-6.8/io_uring-2024-01-18 2024-01-18 18:17:57 -08:00
ipc shm: Slim down dependencies 2023-12-20 19:26:31 -05:00
kernel bpf: Transfer RCU lock state between subprog calls 2024-02-05 20:00:14 -08:00
lib RISC-V Patches for the 6.8 Merge Window, Part 4 2024-01-20 11:06:04 -08:00
LICENSES
mm vfs-6.8.netfs 2024-01-19 09:10:23 -08:00
net xsk: support redirect to any socket bound to the same umem 2024-02-05 20:01:15 -08:00
rust rust: phy: use VTABLE_DEFAULT_ERROR 2024-01-27 14:28:00 +00:00
samples samples/cgroup: add .gitignore file for generated samples 2024-01-24 11:52:40 -08:00
scripts bpf: Generate const static pointers for kernel helpers 2024-01-29 16:46:12 -08:00
security bpf-next-for-netdev 2024-01-26 21:08:22 -08:00
sound sound fixes for 6.8-rc1 2024-01-19 12:30:29 -08:00
tools tools/resolve_btfids: Fix cross-compilation to non-host endianness 2024-02-07 15:56:18 -08:00
usr Kbuild updates for v6.8 2024-01-18 17:57:07 -08:00
virt Generic: 2024-01-17 13:03:37 -08:00
.clang-format clang-format: Update with v6.7-rc4's for_each macro list 2023-12-08 23:54:38 +01:00
.cocciconfig
.editorconfig Add .editorconfig file for basic formatting 2023-12-28 16:22:47 +09:00
.get_maintainer.ignore
.gitattributes
.gitignore Add .editorconfig file for basic formatting 2023-12-28 16:22:47 +09:00
.mailmap Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
.rustfmt.toml
COPYING
CREDITS Including fixes from bpf and netfilter. 2024-01-18 17:33:50 -08:00
Kbuild
Kconfig
MAINTAINERS bpf-next-for-netdev 2024-01-26 21:08:22 -08:00
Makefile init: Kconfig: Disable -Wstringop-overflow for GCC-11 2024-01-21 17:45:31 -06:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.