-
Notifications
You must be signed in to change notification settings - Fork 173
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(gvisor): handle arbitrary sandbox IDs #1612
fix(gvisor): handle arbitrary sandbox IDs #1612
Conversation
4b083d9
to
585bf2c
Compare
/milestone 0.14.1 |
Signed-off-by: Luca Guerra <luca@guerra.sh>
Signed-off-by: Luca Guerra <luca@guerra.sh>
585bf2c
to
f261c11
Compare
Signed-off-by: Luca Guerra <luca@guerra.sh>
Signed-off-by: Luca Guerra <luca@guerra.sh>
10dad91
to
055e412
Compare
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
LGTM label has been added. Git tree hash: 9b354632cae65189231ef3771100df12e9230cb4
|
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
@@ -534,8 +553,10 @@ int32_t engine::next(scap_evt **pevent, uint16_t *pdevid, uint32_t *pflags) | |||
sandbox_entry &sandbox = it->second; | |||
if(sandbox.m_closing) | |||
{ | |||
std::string container_id = sandbox.m_container_id; |
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.
Shouldn't this be sandbox.m_id
?
I mean, release_sandbox_id
takes the sandbox id as argument...
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.
The names are a little confusing I understand, but the container_id
is the string which is the one that release_sandbox_id
takes as parameter
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP, loresuso, 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 |
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area libscap-engine-gvisor
Does this PR require a change in the driver versions?
No.
What this PR does / why we need it:
In the gvisor engine we handle the sandbox ID by generating a numeric value to represent it and using it in the pid/tid fields to distinguish between containers. This was initially extracted from the string itself if it was written in hex (like it is normally in containerd, docker, ...) but it is not a reliable way because it does not handle arbitrary strings or collisions.
This PR fixes it by implementing the following:
Which issue(s) this PR fixes:
Fixes #1602
Special notes for your reviewer:
Does this PR introduce a user-facing change?: