diff options
| author | Paul Buetow <paul@buetow.org> | 2024-02-23 19:47:38 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-02-23 19:47:38 +0200 |
| commit | 306ebf54a2f270f1cbdf1307ad4c860caad579a9 (patch) | |
| tree | 6b98cab2a957b0f8836391ea129969efe5b3e4a8 /internal | |
| parent | e56a65aef99f7ff1c00ccc8b118d2e98c1f1409a (diff) | |
as of now, only pid filter supported.
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/c/filter.c | 3 | ||||
| -rw-r--r-- | internal/c/flags.h | 1 | ||||
| -rw-r--r-- | internal/flags/flags.go | 5 |
3 files changed, 0 insertions, 9 deletions
diff --git a/internal/c/filter.c b/internal/c/filter.c index ca8374a..06ecb33 100644 --- a/internal/c/filter.c +++ b/internal/c/filter.c @@ -11,8 +11,5 @@ static __always_inline int filter(__u32 *pid, __u32 *tid) { if (*pid == PID_FILTER) return ACCEPT; - if ((bpf_get_current_uid_gid() & 0xFFFFFFFF) == UID_FILTER) - return 0; - return FILTER; } diff --git a/internal/c/flags.h b/internal/c/flags.h index c123fa4..0bb9492 100644 --- a/internal/c/flags.h +++ b/internal/c/flags.h @@ -1,4 +1,3 @@ //+build ignore -const volatile u32 UID_FILTER = -1; const volatile u32 PID_FILTER = -1; diff --git a/internal/flags/flags.go b/internal/flags/flags.go index 37797a4..1d2c11e 100644 --- a/internal/flags/flags.go +++ b/internal/flags/flags.go @@ -8,13 +8,11 @@ import ( ) type Flags struct { - UidFilter int PidFilter int EventMapSize int } func New() (flags Flags) { - flag.IntVar(&flags.UidFilter, "uid", 0, "Filter for user ID") flag.IntVar(&flags.PidFilter, "pid", 0, "Filter for processes ID") flag.IntVar(&flags.EventMapSize, "mapSize", 4096*16, "BPF FD event ring buffer map size") flag.Parse() @@ -23,9 +21,6 @@ func New() (flags Flags) { } func (flags Flags) SetBPF(bpfModule *bpf.Module) error { - if err := bpfModule.InitGlobalVariable("UID_FILTER", uint32(flags.UidFilter)); err != nil { - return fmt.Errorf("unable to set up UID_FILTER global variable: %w", err) - } if err := bpfModule.InitGlobalVariable("PID_FILTER", uint32(flags.PidFilter)); err != nil { return fmt.Errorf("unable to set up PID_FILTER global variable: %w", err) } |
