]> git.itanic.dy.fi Git - linux-stable/commit
selftests: bpf: Fix detach from sockmap tests
authorLorenz Bauer <lmb@cloudflare.com>
Thu, 9 Jul 2020 11:51:51 +0000 (12:51 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 9 Jul 2020 21:41:37 +0000 (23:41 +0200)
commitf43cb0d672aa8eb09bfdb779de5900c040487d1d
tree7091bfdbb53f352d9e692aeb7d245cfab7807d70
parentc9a368f1c0fbe2e3a21ebf231caeae58b18b2681
selftests: bpf: Fix detach from sockmap tests

Fix sockmap tests which rely on old bpf_prog_dispatch behaviour.
In the first case, the tests check that detaching without giving
a program succeeds. Since these are not the desired semantics,
invert the condition. In the second case, the clean up code doesn't
supply the necessary program fds.

Fixes: bb0de3131f4c ("bpf: sockmap: Require attach_bpf_fd when detaching a program")
Reported-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/20200709115151.75829-1-lmb@cloudflare.com
tools/testing/selftests/bpf/test_maps.c