-
Notifications
You must be signed in to change notification settings - Fork 383
krun: stop using set_workdir #1716
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
Conversation
Stop using set_workdir, which can be dangerous, and rely exclusively on the config file for setting up the workdir in the container. Fixes: containers#1691 Signed-off-by: Sergio Lopez <[email protected]>
Reviewer's Guide by SourceryThis pull request removes the usage of Sequence diagram for libkrun_exec function call flow (after removal of set_workdir)sequenceDiagram
participant libkrun_exec
participant krun_set_root
participant libkrun_configure_vm
libkrun_exec->>krun_set_root: krun_set_root (ctx_id, "/")
activate krun_set_root
krun_set_root-->>libkrun_exec: returns ret
deactivate krun_set_root
libkrun_exec->>libkrun_configure_vm: libkrun_configure_vm (ctx_id, handle, &configured, &err)
activate libkrun_configure_vm
libkrun_configure_vm-->>libkrun_exec: returns ret
deactivate libkrun_configure_vm
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @slp - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a comment explaining why
krun_set_workdiris considered dangerous. - It might be worth adding a check to ensure that the config file is actually setting the workdir.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
giuseppe
left a comment
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 |
|
Side note, The protection is provided by the combination of HW Virtualization on top of the usual container-based protections (cgroups, namespaces, selinux, etc...). |
Stop using set_workdir, which can be dangerous, and rely exclusively on the config file for setting up the workdir in the container.
Fixes: #1691
Summary by Sourcery
Remove the use of set_workdir function in krun handler, relying exclusively on the config file for setting up the container's working directory.
Bug Fixes:
Enhancements: