Skip to content

Commit

Permalink
feat(ebpf): restrict set_fs_pwd to (f)chdir syscall (#4359) (#4361)
Browse files Browse the repository at this point in the history
commit: ab6344f (main), cherry-pick

Co-authored-by: OriGlassman <[email protected]>
  • Loading branch information
geyslan and OriGlassman authored Oct 21, 2024
1 parent 1e8fc73 commit dc7e08f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/ebpf/c/tracee.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5088,6 +5088,9 @@ int BPF_KPROBE(trace_set_fs_pwd)
if (!init_program_data(&p, ctx, SET_FS_PWD))
return 0;

if (p.event->context.syscall != SYSCALL_CHDIR && p.event->context.syscall != SYSCALL_FCHDIR)
return 0;

if (!evaluate_scope_filters(&p))
return 0;

Expand Down

0 comments on commit dc7e08f

Please sign in to comment.