Skip to content

Commit

Permalink
add changes from #1969
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan-sharma11 <[email protected]>
  • Loading branch information
Aryan-sharma11 authored and daemon1024 committed Feb 13, 2025
1 parent 9b5456f commit b749390
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions KubeArmor/BPF/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -661,13 +661,13 @@ static inline int match_and_enforce_path_hooks(struct path *f_path, u32 id,
}
}

if (retval == -EPERM) {
goto ringbuf;
}

bpf_map_update_elem(&bufk, &two, z, BPF_ANY);
pk->path[0] = dfile;
struct data_t *allow = bpf_map_lookup_elem(inner, pk);

if (retval == -EPERM && !(allow && !fromSourceCheck)) {
goto ringbuf;
}

if (allow) {
if (!match) {
Expand Down Expand Up @@ -697,14 +697,16 @@ static inline int match_and_enforce_path_hooks(struct path *f_path, u32 id,
}
}

if (retval == -EPERM) {
goto ringbuf;
}


bpf_map_update_elem(&bufk, &two, z, BPF_ANY);
pk->path[0] = dfile;
struct data_t *allow = bpf_map_lookup_elem(inner, pk);

if (retval == -EPERM && !(allow && !fromSourceCheck)) {
goto ringbuf;
}

if (allow) {
if (!match) {
if (allow->processmask == BLOCK_POSTURE) {
Expand Down
Binary file modified KubeArmor/enforcer/bpflsm/enforcer_bpfeb.o
Binary file not shown.
Binary file modified KubeArmor/enforcer/bpflsm/enforcer_bpfel.o
Binary file not shown.
Binary file modified KubeArmor/enforcer/bpflsm/enforcer_path_bpfeb.o
Binary file not shown.
Binary file modified KubeArmor/enforcer/bpflsm/enforcer_path_bpfel.o
Binary file not shown.

0 comments on commit b749390

Please sign in to comment.