Skip to content
Open
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
5 changes: 0 additions & 5 deletions fact-ebpf/src/bpf/events.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ __always_inline static void __submit_event(struct submit_event_args_t* args,
event->filename[0] = '\0';
}

struct helper_t* helper = get_helper();
if (helper == NULL) {
goto error;
}

int64_t err = process_fill(&event->process, use_bpf_d_path);
if (err) {
bpf_printk("Failed to fill process information: %d", err);
Expand Down
7 changes: 3 additions & 4 deletions fact-ebpf/src/bpf/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ __always_inline static long read_exe_file(struct task_struct* task, char buf[PAT
}
}

__always_inline static void process_fill_lineage(process_t* p, struct helper_t* helper, bool use_bpf_d_path) {
__always_inline static void process_fill_lineage(process_t* p, bool use_bpf_d_path) {
struct task_struct* task = bpf_task_acquire(bpf_get_current_task_btf());
if (task == NULL) {
return;
Expand Down Expand Up @@ -130,7 +130,6 @@ __always_inline static unsigned long get_mount_ns() {

__always_inline static int64_t process_fill(process_t* p, bool use_bpf_d_path) {
struct task_struct* task = (struct task_struct*)bpf_get_current_task_btf();
uint32_t key = 0;
uint64_t uid_gid = bpf_get_current_uid_gid();
p->uid = uid_gid & 0xFFFFFFFF;
p->gid = (uid_gid >> 32) & 0xFFFFFFFF;
Expand All @@ -152,7 +151,7 @@ __always_inline static int64_t process_fill(process_t* p, bool use_bpf_d_path) {
return err;
}

struct helper_t* helper = bpf_map_lookup_elem(&helper_map, &key);
struct helper_t* helper = get_helper();
if (helper == NULL) {
bpf_printk("Failed to get helper entry");
return -1;
Expand All @@ -167,7 +166,7 @@ __always_inline static int64_t process_fill(process_t* p, bool use_bpf_d_path) {

p->in_root_mount_ns = get_mount_ns() == host_mount_ns;

process_fill_lineage(p, helper, use_bpf_d_path);
process_fill_lineage(p, use_bpf_d_path);

return 0;
}
Loading