-
Notifications
You must be signed in to change notification settings - Fork 162
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
new(scap): Support gVisor no_events mode/full proc scan for nodriver #997
Conversation
Co-authored-by: Angelo Puglisi <angelopuglisi86@gmail.com> Signed-off-by: Angelo Puglisi <angelopuglisi86@gmail.com> Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
The nodriver engine is still the only user of limited /proc scan but we no longer check handle->m_mode. Instead we have a dedicated flag. This lets us have the nodriver engine with a full /proc scan if we want. Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
The patch is somewhat weird because it introduces an option for the nodriver engine which is used only by the main libscap code (the /proc scan does not live in the engine). Still, we're (logically) configuring the nodriver engine, I believe the flag belongs in the engine config. Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
This new flag means that we're *not* going to get any events from the engine and are using it just for the secondary effects of scap_open (mostly getting the process table). This is needed to safely open a new inspector while another one exists. Otherwise we'd overwrite the gVisor socket with a new one (which would become inactive the moment we close the second inspector), breaking all future gVisor connections. Co-Authored-By: Angelo Puglisi <angelopuglisi86@gmail.com> Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
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.
Thank you for this!
/approve
LGTM label has been added. Git tree hash: 305303c28bee699f3c873699f4f2a2506d48e1a6
|
cc @LucaGuerra |
@@ -97,7 +97,7 @@ engine::~engine() | |||
|
|||
} | |||
|
|||
int32_t engine::init(std::string config_path, std::string root_path) | |||
int32_t engine::init(std::string config_path, std::string root_path, bool no_events) |
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.
Not related to this change, but we're copying strings here
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.
I personally don't think copying strings is an issue here. It certainly isn't for this PR :)
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.
LGTM, only have a very minor comment
When that's resolved you can remove the hold to get it merged :) Thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, gnosek, LucaGuerra 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 |
/unhold |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area libscap-engine-gvisor
/area libscap-engine-nodriver
Does this PR require a change in the driver versions?
What this PR does / why we need it:
This PR is a smaller patch to achieve the same thing as #986. Instead of introducing a no_events mode for all engines, it introduces one just for gVisor. kmod/bpf/modern_bpf can use the nodriver engine instead (with the new full_proc_scan=true flag) to achieve the same result.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: