]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
selftests/bpf: fix stacktrace_build_id with missing kprobe/urandom_read
authorSong Liu <song@kernel.org>
Thu, 26 May 2022 19:16:08 +0000 (12:16 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:52:47 +0000 (10:52 +0200)
commit805777c0ab574d15240d8c2f6ea0c0062fa888fa
tree768ea37982f5ffec143f53584191745046aad15d
parentdfff1a5e1c85980ea58ab74664027b310e9f63af
selftests/bpf: fix stacktrace_build_id with missing kprobe/urandom_read

BugLink: https://bugs.launchpad.net/bugs/1982968
[ Upstream commit 59ed76fe2f981bccde37bdddb465f260a96a2404 ]

Kernel function urandom_read is replaced with urandom_read_iter.
Therefore, kprobe on urandom_read is not working any more:

[root@eth50-1 bpf]# ./test_progs -n 161
test_stacktrace_build_id:PASS:skel_open_and_load 0 nsec
libbpf: kprobe perf_event_open() failed: No such file or directory
libbpf: prog 'oncpu': failed to create kprobe 'urandom_read+0x0' \
        perf event: No such file or directory
libbpf: prog 'oncpu': failed to auto-attach: -2
test_stacktrace_build_id:FAIL:attach_tp err -2
161     stacktrace_build_id:FAIL

Fix this by replacing urandom_read with urandom_read_iter in the test.

Fixes: 1b388e7765f2 ("random: convert to using fops->read_iter()")
Reported-by: Mykola Lysenko <mykolal@fb.com>
Signed-off-by: Song Liu <song@kernel.org>
Acked-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/r/20220526191608.2364049-1-song@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
tools/testing/selftests/bpf/progs/test_stacktrace_build_id.c