Skip to content

Commit 90ac9b1

Browse files
ekoopspoiana
authored andcommitted
feat!: drop setre{uid,gid} enter evts gen, testing and parsing code
As the `setre{uid,gid}` exit events contain all the information needed, drop `setre{uid,gid}` enter events generation from all drivers, and all related testing and parsing code. BREAKING CHANGE: drop `setre{uid,gid}` enter evts gen and parsing Signed-off-by: Leonardo Di Giovanna <[email protected]>
1 parent fa8b997 commit 90ac9b1

File tree

6 files changed

+4
-132
lines changed

6 files changed

+4
-132
lines changed

driver/fillers_table.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,12 @@ const struct ppm_event_entry g_ppm_events[PPM_EVENT_MAX] = {
379379
[PPME_SYSCALL_PROCESS_VM_WRITEV_X] = {FILLER_REF(sys_process_vm_writev_x)},
380380
[PPME_SYSCALL_DELETE_MODULE_E] = {FILLER_REF(sys_empty)},
381381
[PPME_SYSCALL_DELETE_MODULE_X] = {FILLER_REF(sys_delete_module_x)},
382-
[PPME_SYSCALL_SETREUID_E] = {FILLER_REF(sys_empty)},
382+
[PPME_SYSCALL_SETREUID_E] = {FILLER_DISABLED},
383383
[PPME_SYSCALL_SETREUID_X] = {FILLER_REF(sys_autofill),
384384
3,
385385
APT_REG,
386386
{{AF_ID_RETVAL}, {0}, {1}}},
387-
[PPME_SYSCALL_SETREGID_E] = {FILLER_REF(sys_empty)},
387+
[PPME_SYSCALL_SETREGID_E] = {FILLER_DISABLED},
388388
[PPME_SYSCALL_SETREGID_X] = {FILLER_REF(sys_autofill),
389389
3,
390390
APT_REG,

driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/setregid.bpf.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,6 @@
88

99
#include <helpers/interfaces/fixed_size_event.h>
1010

11-
/*=============================== ENTER EVENT ===========================*/
12-
13-
SEC("tp_btf/sys_enter")
14-
int BPF_PROG(setregid_e, struct pt_regs *regs, long id) {
15-
struct ringbuf_struct ringbuf;
16-
if(!ringbuf__reserve_space(&ringbuf, SETREGID_E_SIZE, PPME_SYSCALL_SETREGID_E)) {
17-
return 0;
18-
}
19-
20-
ringbuf__store_event_header(&ringbuf);
21-
22-
/*=============================== COLLECT PARAMETERS ===========================*/
23-
24-
/*=============================== COLLECT PARAMETERS ===========================*/
25-
26-
ringbuf__submit_event(&ringbuf);
27-
28-
return 0;
29-
}
30-
31-
/*=============================== ENTER EVENT ===========================*/
32-
3311
/*=============================== EXIT EVENT ===========================*/
3412

3513
SEC("tp_btf/sys_exit")

driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/setreuid.bpf.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,6 @@
88

99
#include <helpers/interfaces/fixed_size_event.h>
1010

11-
/*=============================== ENTER EVENT ===========================*/
12-
13-
SEC("tp_btf/sys_enter")
14-
int BPF_PROG(setreuid_e, struct pt_regs *regs, long id) {
15-
struct ringbuf_struct ringbuf;
16-
if(!ringbuf__reserve_space(&ringbuf, SETREUID_E_SIZE, PPME_SYSCALL_SETREUID_E)) {
17-
return 0;
18-
}
19-
20-
ringbuf__store_event_header(&ringbuf);
21-
22-
/*=============================== COLLECT PARAMETERS ===========================*/
23-
24-
/*=============================== COLLECT PARAMETERS ===========================*/
25-
26-
ringbuf__submit_event(&ringbuf);
27-
28-
return 0;
29-
}
30-
31-
/*=============================== ENTER EVENT ===========================*/
32-
3311
/*=============================== EXIT EVENT ===========================*/
3412

3513
SEC("tp_btf/sys_exit")

test/drivers/test_suites/syscall_enter_suite/setregid_e.cpp

Lines changed: 0 additions & 42 deletions
This file was deleted.

test/drivers/test_suites/syscall_enter_suite/setreuid_e.cpp

Lines changed: 0 additions & 42 deletions
This file was deleted.

userspace/libpman/src/events_prog_table.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ event_prog_t event_prog_table[PPM_EVENT_MAX][MAX_FEATURE_CHECKS] = {
337337
[PPME_SYSCALL_PROCESS_VM_WRITEV_X] = {{false, "process_vm_writev_x", 0}},
338338
[PPME_SYSCALL_DELETE_MODULE_E] = {{false, "delete_module_e", 0}},
339339
[PPME_SYSCALL_DELETE_MODULE_X] = {{false, "delete_module_x", 0}},
340-
[PPME_SYSCALL_SETREUID_E] = {{false, "setreuid_e", 0}},
340+
[PPME_SYSCALL_SETREUID_E] = {{true, NULL}},
341341
[PPME_SYSCALL_SETREUID_X] = {{false, "setreuid_x", 0}},
342-
[PPME_SYSCALL_SETREGID_E] = {{false, "setregid_e", 0}},
342+
[PPME_SYSCALL_SETREGID_E] = {{true, NULL}},
343343
[PPME_SYSCALL_SETREGID_X] = {{false, "setregid_x", 0}},
344344
// TODO(ekoops): remove the following entries once the sys_enter dispatcher is dropped.
345345
// The following entries are added in order to avoid the common generic_e enter event

0 commit comments

Comments
 (0)