wip: chore: minor improvements; mainly: dropped g_syscall_code_routing_table and added an m4 script to automatically create syscall tables (normal + ia32)#86
Conversation
|
Hi @FedeDP. Thanks for your PR. I'm waiting for a falcosecurity member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/ok-to-test |
|
/retest |
cbcb25c to
338fddd
Compare
|
Rebased on master. |
338fddd to
23e6ee1
Compare
|
Closing and reopening to trigger the CI |
|
@leogr: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/reopen |
|
@leogr: Reopened this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
601be0f to
45c1c2f
Compare
45c1c2f to
d5ed911
Compare
d5ed911 to
925bd15
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1c59f39 to
3ebf236
Compare
|
/test build-libs-bundled-deps |
|
/test build-libs-with-chisels |
3ebf236 to
75c1523
Compare
…array member to struct ppm_evt_hdr to manage events payload (both len headers and actual event data) without abusing c pointer arithmetic. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
…le` into `g_syscall_table`. They were the exactly same table (ie: same indexes) but with different values. Extended `struct syscall_evt_pair` adding a syscall name member, and a `ppm_code' member. Moreover, dropped syscall_table.c in favour of syscall_table.m4 script that will automatically build syscall_table.c at compile time. This allows adding a new syscall by just inserting a one-liner in the new `X_SYSCALLS` X macro. Note also that now all __NR_(ia32_)_foo code is protected by ifdef, as it makes sense. Finally, added old syscall_table.c to gitignore for the driver folder. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Moreover, updated driver CMakeLists to always refresh syscall_table.c during builds. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
75c1523 to
d803370
Compare
|
I think i will split this PR in:
The latter is quite opinionated and might not be merged soon; the former instead should have the consensus to be merged. |
Hey @FedeDP I totally agree with splitting this into several PRs. I'm also ok with C99. Moreover, I'd suggest documenting somewhere the C standard we are going to use. |
|
/hold |
|
/test build-libs-bundled-deps |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh with Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with Provide feedback via https://github.com/falcosecurity/community. /lifecycle stale |
|
Stale issues rot after 30d of inactivity. Mark the issue as fresh with Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with Provide feedback via https://github.com/falcosecurity/community. /lifecycle rotten |
|
Rotten issues close after 30d of inactivity. Reopen the issue with Mark the issue as fresh with Provide feedback via https://github.com/falcosecurity/community. |
|
@poiana: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Most of this PR was split in multiple ones.
|
What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area libscap
What this PR does / why we need it:
Std states:
Note about the padding: we use an uint8_t for flexible array member, thus it shall not change padding in our case: you store sizeof(ppm_evt_hdr) + sizeof hdrs + sizeof(payload) and you load exactly the same;
but the flexible array member helps in avoiding pointer arithmetic when dealing with hdrs and payload.
I tested the dump/read of scap files:
g_syscall_code_routing_tableintog_syscall_tableThe
g_syscall_code_routing_tablewas not really useful by itself, and the 2 tables had same indexing.at compile time. It allows adding a new syscall by just inserting a one-liner in the new
X_SYSCALLSX macro.It uses an m4 script; i think that m4 is the most widely available solution.
Why does this latter change matter? Because we were already hit by issues like forgetting to populate ia32 syscalls, or forgetting to populate
PPM_SC_code (the latter case is already somewhat mitigated by above point).Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?: