Skip to content

Commit

Permalink
deleting untraced file access entries in file_map
Browse files Browse the repository at this point in the history
Signed-off-by: Prateek Nandle <prateeknandle@gmail.com>
  • Loading branch information
Prateeknandle committed Oct 20, 2023
1 parent c4270dd commit cfbeb8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions KubeArmor/BPF/system_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,11 @@ int kprobe__do_exit(struct pt_regs *ctx)
if (skip_syscall())
return 0;

u64 tgid = bpf_get_current_pid_tgid();

// delete entry for file access which are not successful and are not deleted from file_map since kretprobe/__x64_sys_openat hook is not triggered
bpf_map_delete_elem(&file_map, &tgid);

sys_context_t context = {};

const long code = PT_REGS_PARM1(ctx);
Expand Down

0 comments on commit cfbeb8b

Please sign in to comment.