-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(driver): drop EF_USES_FD and EF_MODIFIES_STATE flags for enter events generated by uring syscalls #395
fix(driver): drop EF_USES_FD and EF_MODIFIES_STATE flags for enter events generated by uring syscalls #395
Conversation
…scalls The ENTER events of io_uring_enter and io_uring_register syscalls had the EF_USES_FD. But since both syscalls return 0 parameters, it causes the the libs to crash with the following error: Runtime error: vector::_M_range_check: __n (which is 0) >= this->size() (which is 0). Exiting. That is because the code tries to access the file descriptor on the event that has the EF_USES_FD flag. Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
Hi @alacuku. 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. 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. |
Thank you @alacuku! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
LGTM label has been added. Git tree hash: 448103615648e28f32b96defd46887a5691f88b7
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alacuku, Andreagit97 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch, thank you!
/test build-libs-bundled-deps |
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area driver-kmod
/area driver-bpf
What this PR does / why we need it:
This PR prevents
libs
from crashing when handling events generated byio_uring_enter
andio_uring_register
syscalls.Which issue(s) this PR fixes:
Fixes #
When Falco is running with
-A
option enabled and receives events generated byio_uring_enter
andio_uring_register
syscalls it crashes with the following error:That is because
ENTER
events for theio_uring_enter
andio_uring_register
syscalls presented theEF_USES_FD
flag. When the flag is set thelibsinsp
tries to extract thefile descriptor
from the event:libs/userspace/libsinsp/parsers.cpp
Lines 689 to 703 in afca72c
Since the event does not have any parameters and we are trying to access the first one it causes a runtime error.
Special notes for your reviewer:
Does this PR introduce a user-facing change?: