summaryrefslogtreecommitdiff
path: root/samples/bpf/test_probe_write_user_kern.c
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2019-11-02 02:18:01 +0300
committerAlexei Starovoitov <ast@kernel.org>2019-11-02 22:39:13 +0300
commit251e2d337a1a4f2572439ea29fd27f8699c5c368 (patch)
tree53bc31ae0551e46b9dadc29dbbb7cc44fef1425d /samples/bpf/test_probe_write_user_kern.c
parent6e07a6341277a1dbdf5ed0c41921033c234c1635 (diff)
downloadlinux-251e2d337a1a4f2572439ea29fd27f8699c5c368.tar.xz
bpf, samples: Use bpf_probe_read_user where appropriate
Use bpf_probe_read_user() helper instead of bpf_probe_read() for samples that attach to kprobes probing on user addresses. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/5b0144b3f8e031ec5e2438bd7de8d7877e63bf2f.1572649915.git.daniel@iogearbox.net
Diffstat (limited to 'samples/bpf/test_probe_write_user_kern.c')
-rw-r--r--samples/bpf/test_probe_write_user_kern.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/bpf/test_probe_write_user_kern.c b/samples/bpf/test_probe_write_user_kern.c
index a543358218e6..b7c48f37132c 100644
--- a/samples/bpf/test_probe_write_user_kern.c
+++ b/samples/bpf/test_probe_write_user_kern.c
@@ -37,7 +37,7 @@ int bpf_prog1(struct pt_regs *ctx)
if (sockaddr_len > sizeof(orig_addr))
return 0;
- if (bpf_probe_read(&orig_addr, sizeof(orig_addr), sockaddr_arg) != 0)
+ if (bpf_probe_read_user(&orig_addr, sizeof(orig_addr), sockaddr_arg) != 0)
return 0;
mapped_addr = bpf_map_lookup_elem(&dnat_map, &orig_addr);