Skip to content

Commit

Permalink
Fix `failed to attach to tracepoint 'syscalls/sys_exit_execve': Permi…
Browse files Browse the repository at this point in the history
…ssion denied` (#43783)
  • Loading branch information
jakule authored Jul 10, 2024
1 parent 95096dc commit 974db41
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions bpf/enhancedrecording/command.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static int exit_execve(int ret)
}

SEC("tp/syscalls/sys_execve")
int tracepoint__syscalls__sys_enter_execve(struct trace_event_raw_sys_enter *tp)
int tracepoint__syscalls__sys_enter_execve(struct syscall_trace_enter *tp)
{
const char *filename = (const char *)tp->args[0];
const char *const *argv = (const char *const *)tp->args[1];
Expand All @@ -175,13 +175,13 @@ int tracepoint__syscalls__sys_enter_execve(struct trace_event_raw_sys_enter *tp)
}

SEC("tp/syscalls/sys_exit_execve")
int tracepoint__syscalls__sys_exit_execve(struct trace_event_raw_sys_exit *tp)
int tracepoint__syscalls__sys_exit_execve(struct syscall_trace_exit *tp)
{
return exit_execve(tp->ret);
}

SEC("tp/syscalls/sys_execveat")
int tracepoint__syscalls__sys_enter_execveat(struct trace_event_raw_sys_enter *tp)
int tracepoint__syscalls__sys_enter_execveat(struct syscall_trace_enter *tp)
{
const char *filename = (const char *)tp->args[1];
const char *const *argv = (const char *const *)tp->args[2];
Expand All @@ -191,7 +191,7 @@ int tracepoint__syscalls__sys_enter_execveat(struct trace_event_raw_sys_enter *t
}

SEC("tp/syscalls/sys_exit_execveat")
int tracepoint__syscalls__sys_exit_execveat(struct trace_event_raw_sys_exit *tp)
int tracepoint__syscalls__sys_exit_execveat(struct syscall_trace_exit *tp)
{
return exit_execve(tp->ret);
}
4 changes: 2 additions & 2 deletions bpf/enhancedrecording/counter_test.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ char LICENSE[] SEC("license") = "Dual BSD/GPL";
BPF_COUNTER(test_counter);

SEC("tp/syscalls/sys_close")
int tracepoint__syscalls__sys_enter_close(struct trace_event_raw_sys_enter *tp)
int tracepoint__syscalls__sys_enter_close(struct syscall_trace_enter *tp)
{
int fd = (int)tp->args[0];

Expand All @@ -23,7 +23,7 @@ int tracepoint__syscalls__sys_enter_close(struct trace_event_raw_sys_enter *tp)
}

SEC("tp/syscalls/sys_exit_close")
int tracepoint__syscalls__sys_exit_close(struct trace_event_raw_sys_exit *tp)
int tracepoint__syscalls__sys_exit_close(struct syscall_trace_exit *tp)
{
return 0;
}
16 changes: 8 additions & 8 deletions bpf/enhancedrecording/disk.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ static int exit_open(int ret) {


SEC("tp/syscalls/sys_enter_creat")
int tracepoint__syscalls__sys_enter_creat(struct trace_event_raw_sys_enter *tp)
int tracepoint__syscalls__sys_enter_creat(struct syscall_trace_enter *tp)
{
const char *filename = (const char*) tp->args[0];

return enter_open(filename, 0);
}

SEC("tp/syscalls/sys_exit_creat")
int tracepoint__syscalls__sys_exit_creat(struct trace_event_raw_sys_exit *tp)
int tracepoint__syscalls__sys_exit_creat(struct syscall_trace_exit *tp)
{
return exit_open(tp->ret);
}
Expand All @@ -114,7 +114,7 @@ int tracepoint__syscalls__sys_exit_creat(struct trace_event_raw_sys_exit *tp)
#ifndef __TARGET_ARCH_arm64

SEC("tp/syscalls/sys_enter_open")
int tracepoint__syscalls__sys_enter_open(struct trace_event_raw_sys_enter *tp)
int tracepoint__syscalls__sys_enter_open(struct syscall_trace_enter *tp)
{
const char *filename = (const char*) tp->args[0];
int flags = tp->args[1];
Expand All @@ -125,13 +125,13 @@ int tracepoint__syscalls__sys_enter_open(struct trace_event_raw_sys_enter *tp)
#endif // __aarch64__

SEC("tp/syscalls/sys_exit_open")
int tracepoint__syscalls__sys_exit_open(struct trace_event_raw_sys_exit *tp)
int tracepoint__syscalls__sys_exit_open(struct syscall_trace_exit *tp)
{
return exit_open(tp->ret);
}

SEC("tp/syscalls/sys_enter_openat")
int tracepoint__syscalls__sys_enter_openat(struct trace_event_raw_sys_enter *tp)
int tracepoint__syscalls__sys_enter_openat(struct syscall_trace_enter *tp)
{
const char *filename = (const char*) tp->args[1];
int flags = tp->args[2];
Expand All @@ -140,13 +140,13 @@ int tracepoint__syscalls__sys_enter_openat(struct trace_event_raw_sys_enter *tp)
};

SEC("tp/syscalls/sys_exit_openat")
int tracepoint__syscalls__sys_exit_openat(struct trace_event_raw_sys_exit *tp)
int tracepoint__syscalls__sys_exit_openat(struct syscall_trace_exit *tp)
{
return exit_open(tp->ret);
}

SEC("tp/syscalls/sys_enter_openat2")
int tracepoint__syscalls__sys_enter_openat2(struct trace_event_raw_sys_enter *tp)
int tracepoint__syscalls__sys_enter_openat2(struct syscall_trace_enter *tp)
{
const char *filename = (const char*) tp->args[1];
struct open_how *how = (struct open_how *) tp->args[2];
Expand All @@ -155,7 +155,7 @@ int tracepoint__syscalls__sys_enter_openat2(struct trace_event_raw_sys_enter *tp
};

SEC("tp/syscalls/sys_exit_openat2")
int tracepoint__syscalls__sys_exit_openat2(struct trace_event_raw_sys_exit *tp)
int tracepoint__syscalls__sys_exit_openat2(struct syscall_trace_exit *tp)
{
return exit_open(tp->ret);
}

0 comments on commit 974db41

Please sign in to comment.