Skip to content

Commit

Permalink
tools/opensnoop: Use bpf_probe_read_user explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
zb3 authored and yonghong-song committed Dec 17, 2020
1 parent 3e00893 commit 24f4759
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/opensnoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@
{
int dfd = PT_REGS_PARM1(regs);
const char __user *filename = (char *)PT_REGS_PARM2(regs);
struct open_how __user *how = (struct open_how *)PT_REGS_PARM3(regs);
int flags = how->flags;
struct open_how __user how;
int flags;
bpf_probe_read_user(&how, sizeof(struct open_how), (struct open_how*)PT_REGS_PARM3(regs));
flags = how.flags;
#else
KRETFUNC_PROBE(FNNAME, int dfd, const char __user *filename, struct open_how __user *how, int ret)
{
Expand Down

0 comments on commit 24f4759

Please sign in to comment.