]> git.baikalelectronics.ru Git - 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:41 +0000 (14:23 +0200)
commit564ec27f81c73a12dd89726014447b57da7805b8
tree18a70db5f409492fd2f3e62558ed6d80aa5786bd
parentc9faad32bf48a63e63301f4c233273652e86daed
selftests/bpf: Fix error reporting from sock_fields programs

[ Upstream commit bc4e2e72ea9a5274070628e737d64884098956b0 ]

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 7333fc0592a2 ("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: 7333fc0592a2 ("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>
tools/testing/selftests/bpf/progs/test_sock_fields.c