summaryrefslogtreecommitdiff
path: root/kernel/bpf/stackmap.c
diff options
context:
space:
mode:
authorJakub Sitnicki <jakub@cloudflare.com>2022-03-19 21:33:56 +0300
committerAlexei Starovoitov <ast@kernel.org>2022-03-21 04:59:00 +0300
commitce5236800116d18ac2c06c58f73930406e3ea4be (patch)
treea68caed04866465d23d56a0ce32220741231745a /kernel/bpf/stackmap.c
parent3c69611b8926f8e74fcf76bd97ae0e5dafbeb26a (diff)
downloadlinux-ce5236800116d18ac2c06c58f73930406e3ea4be.tar.xz
selftests/bpf: Fix test for 4-byte load from remote_port on big-endian
The context access converter rewrites the 4-byte load from bpf_sk_lookup->remote_port to a 2-byte load from bpf_sk_lookup_kern structure. It means that we cannot treat the destination register contents as a 32-bit value, or the code will not be portable across big- and little-endian architectures. This is exactly the same case as with 4-byte loads from bpf_sock->dst_port so follow the approach outlined in [1] and treat the register contents as a 16-bit value in the test. [1]: https://lore.kernel.org/bpf/20220317113920.1068535-5-jakub@cloudflare.com/ Fixes: 2ed0dc5937d3 ("selftests/bpf: Cover 4-byte load from remote_port in bpf_sk_lookup") Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20220319183356.233666-4-jakub@cloudflare.com
Diffstat (limited to 'kernel/bpf/stackmap.c')
0 files changed, 0 insertions, 0 deletions