Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.1] backport: bpf: use CORE for execve hook #2468

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions bpf/lib/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,4 @@ static inline __attribute__((always_inline)) size_t generic_kprobe_common_size()
return offsetof(struct msg_generic_kprobe, args);
}

/* tracepoint args */
struct sched_execve_args {
unsigned short common_type;
unsigned char common_flags;
unsigned char common_preempt_count;
int common_pid;
int filename;
int pid;
int old_pid;
};

#endif // _GENERIC__
6 changes: 3 additions & 3 deletions bpf/process/bpf_execve_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ read_exe(struct task_struct *task, struct heap_exe *exe)
#endif

__attribute__((section("tracepoint/sys_execve"), used)) int
event_execve(struct sched_execve_args *ctx)
event_execve(struct trace_event_raw_sched_process_exec *ctx)
{
struct task_struct *task = (struct task_struct *)get_current_task();
char *filename = (char *)ctx + (ctx->filename & 0xFFFF);
char *filename = (char *)ctx + (_(ctx->__data_loc_filename) & 0xFFFF);
struct msg_execve_event *event;
struct execve_map_value *parent;
struct msg_process *p;
Expand Down Expand Up @@ -241,7 +241,7 @@ event_execve(struct sched_execve_args *ctx)
* has already been collected, then send it to the perf buffer.
*/
__attribute__((section("tracepoint/0"), used)) int
execve_send(struct sched_execve_args *ctx)
execve_send(void *ctx)
{
struct msg_execve_event *event;
struct execve_map_value *curr;
Expand Down
Loading