Skip to content

Commit

Permalink
Merge pull request #118 from intelops/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
c-ravela authored Apr 9, 2024
2 parents 70c47e4 + b85e985 commit 7c733f6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tarian/c/utils/filters.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ stain bool can_proceed() {
return true;
}

// has_same_pid checks if the event has same pid as the current task.
stain bool has_same_pid(uint32_t pid) {
struct task_struct *task = (struct task_struct *)bpf_get_current_task();
uint32_t c_pid = get_task_ns_tgid(task);

return (c_pid == pid);
}

stain bool has_same__host_pid(uint32_t pid) {
u64 fpid = bpf_get_current_pid_tgid() >> 32;

return (fpid == pid);
Expand Down

0 comments on commit 7c733f6

Please sign in to comment.