Skip to content

Commit

Permalink
修改:bpf_probe_read修正
Browse files Browse the repository at this point in the history
https: //github.com/iovisor/bcc/issues/3175
Change-Id: I1e31fc6d62a32eebfb68f92ec18c362d14439e30
  • Loading branch information
Your Name committed Feb 7, 2023
1 parent e55bdca commit 5c8f3d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/trace/bpf_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ BPF_CALL_3(bpf_probe_read, void *, dst, u32, size, const void *, unsafe_ptr)

ret = probe_kernel_read(dst, unsafe_ptr, size);
if (unlikely(ret < 0))
goto out;

//https://github.com/iovisor/bcc/issues/3175
ret = probe_user_read(dst, unsafe_ptr, size);
if (unlikely(ret < 0))
out:
memset(dst, 0, size);

Expand Down

0 comments on commit 5c8f3d2

Please sign in to comment.