Commit ce1ce3f8 authored by affansyed's avatar affansyed

fix issue 829

Needed to make array initialized to null before bpf_probe_read as the
verifier was rejecting the original code. will probably need to fix the
tutorial as well
parent 2a3a375c
...@@ -23,7 +23,7 @@ bpf_text = """ ...@@ -23,7 +23,7 @@ bpf_text = """
#include <uapi/linux/ptrace.h> #include <uapi/linux/ptrace.h>
int do_trace(struct pt_regs *ctx) { int do_trace(struct pt_regs *ctx) {
uint64_t addr; uint64_t addr;
char path[128]; char path[128]={0};
bpf_usdt_readarg(6, ctx, &addr); bpf_usdt_readarg(6, ctx, &addr);
bpf_probe_read(&path, sizeof(path), (void *)addr); bpf_probe_read(&path, sizeof(path), (void *)addr);
bpf_trace_printk("path:%s\\n", path); bpf_trace_printk("path:%s\\n", path);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment