Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selftests/bpf: fix probe_user test failure with clang build kernel #1837

Closed
wants to merge 2 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: selftests/bpf: fix probe_user test failure with clang build kernel
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=553639

@kernel-patches-bot
Copy link
Author

Master branch: e7d5184
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=553639
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 4c9f093
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=553639
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: c3e8c44
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=553639
version: 1

@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=553639 expired. Closing PR.

Nobody and others added 2 commits September 28, 2021 20:41
clang build kernel failed the selftest probe_user.
  $ ./test_progs -t probe_user
  $ ...
  $ test_probe_user:PASS:get_kprobe_res 0 nsec
  $ test_probe_user:FAIL:check_kprobe_res wrong kprobe res from probe read: 0.0.0.0:0
  $ #94 probe_user:FAIL

The test attached to kernel function __sys_connect(). In net/socket.c, we have
  int __sys_connect(int fd, struct sockaddr __user *uservaddr, int addrlen)
  {
        ......
  }
  ...
  SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
                  int, addrlen)
  {
        return __sys_connect(fd, uservaddr, addrlen);
  }

The gcc compiler (8.5.0) does not inline __sys_connect() in syscall entry
function. But latest clang trunk did the inlining. So the bpf program
is not triggered.

To make the test more reliable, let us kprobe the syscall entry function
instead. Note that x86_64, arm64 and s390 have syscall wrappers and they have
to be handled specially.

Signed-off-by: Yonghong Song <yhs@fb.com>
@kernel-patches-bot
Copy link
Author

Master branch: 72e1781
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=554695
version: 2

@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=554695 irrelevant now. Closing PR.

@kernel-patches-bot kernel-patches-bot deleted the series/553639=>bpf-next branch September 29, 2021 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants