diff options
author | YiFei Zhu <zhuyifei@google.com> | 2021-12-16 02:04:29 +0000 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-01-19 13:05:13 -0800 |
commit | 1080ef5cc0c2c3419dbdd61e441d1e014410824a (patch) | |
tree | 544557b28f5a9e23ab446bcd10cd004d6099db45 /tools/testing/selftests/bpf/prog_tests/queue_stack_map.c | |
parent | b8bff6f890513e0ae0f711e481b368c1d133c558 (diff) |
selftests/bpf: Update sockopt_sk test to the use bpf_set_retval
The tests would break without this patch, because at one point it calls
getsockopt(fd, SOL_TCP, TCP_ZEROCOPY_RECEIVE, &buf, &optlen)
This getsockopt receives the kernel-set -EINVAL. Prior to this patch
series, the eBPF getsockopt hook's -EPERM would override kernel's
-EINVAL, however, after this patch series, return 0's automatic
-EPERM will not; the eBPF prog has to explicitly bpf_set_retval(-EPERM)
if that is wanted.
I also removed the explicit mentions of EPERM in the comments in the
prog.
Signed-off-by: YiFei Zhu <zhuyifei@google.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/4f20b77cb46812dbc2bdcd7e3fa87c7573bde55e.1639619851.git.zhuyifei@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/queue_stack_map.c')
0 files changed, 0 insertions, 0 deletions