aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/samples/bpf/tracex5_kern.c
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2020-07-20 13:48:06 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-07-21 13:26:26 -0700
commite4d9c2320716ea0e9ef59f503ddd8f253a642ddd (patch)
tree6f0b5d742197e5600edb95fb3a7fc16f1b4c4335 /samples/bpf/tracex5_kern.c
parentselftests/bpf: Fix test_lwt_seg6local.sh hangs (diff)
downloadwireguard-linux-e4d9c2320716ea0e9ef59f503ddd8f253a642ddd.tar.xz
wireguard-linux-e4d9c2320716ea0e9ef59f503ddd8f253a642ddd.zip
samples/bpf, selftests/bpf: Use bpf_probe_read_kernel
A handful of samples and selftests fail to build on s390, because after commit 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work") bpf_probe_read is not available anymore. Fix by using bpf_probe_read_kernel. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200720114806.88823-1-iii@linux.ibm.com
Diffstat (limited to 'samples/bpf/tracex5_kern.c')
-rw-r--r--samples/bpf/tracex5_kern.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/tracex5_kern.c b/samples/bpf/tracex5_kern.c
index 32b49e8ab6bd..64a1f7550d7e 100644
--- a/samples/bpf/tracex5_kern.c
+++ b/samples/bpf/tracex5_kern.c
@@ -47,7 +47,7 @@ PROG(SYS__NR_write)(struct pt_regs *ctx)
{
struct seccomp_data sd;
- bpf_probe_read(&sd, sizeof(sd), (void *)PT_REGS_PARM2(ctx));
+ bpf_probe_read_kernel(&sd, sizeof(sd), (void *)PT_REGS_PARM2(ctx));
if (sd.args[2] == 512) {
char fmt[] = "write(fd=%d, buf=%p, size=%d)\n";
bpf_trace_printk(fmt, sizeof(fmt),
@@ -60,7 +60,7 @@ PROG(SYS__NR_read)(struct pt_regs *ctx)
{
struct seccomp_data sd;
- bpf_probe_read(&sd, sizeof(sd), (void *)PT_REGS_PARM2(ctx));
+ bpf_probe_read_kernel(&sd, sizeof(sd), (void *)PT_REGS_PARM2(ctx));
if (sd.args[2] > 128 && sd.args[2] <= 1024) {
char fmt[] = "read(fd=%d, buf=%p, size=%d)\n";
bpf_trace_printk(fmt, sizeof(fmt),