]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
selftests/bpf: Fix error reporting from sock_fields programs
authorJakub Sitnicki <jakub@cloudflare.com>
Thu, 17 Mar 2022 11:39:17 +0000 (12:39 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:39:14 +0000 (14:39 +0200)
commit8c519668bb8d86e484cf5b8ec60e03048cefc8e8
tree9476f8ae3bdd83a4310063302b4043c6119b2937
parente51b87c5a48031aa9fb975c05da6aabd984ce1ff
selftests/bpf: Fix error reporting from sock_fields programs

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit a4c9fe0ed4a13e25e43fcd44d9f89bc19ba8fbb7 ]

The helper macro that records an error in BPF programs that exercise sock
fields access has been inadvertently broken by adaptation work that
happened in commit b18c1f0aa477 ("bpf: selftest: Adapt sock_fields test to
use skel and global variables").

BPF_NOEXIST flag cannot be used to update BPF_MAP_TYPE_ARRAY. The operation
always fails with -EEXIST, which in turn means the error never gets
recorded, and the checks for errors always pass.

Revert the change in update flags.

Fixes: b18c1f0aa477 ("bpf: selftest: Adapt sock_fields test to use skel and global variables")
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20220317113920.1068535-2-jakub@cloudflare.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 292e8478ae0ae119240841beb221aaba4fcb10e8)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
tools/testing/selftests/bpf/progs/test_sock_fields.c