-
Notifications
You must be signed in to change notification settings - Fork 106
Allow super privileged containers to use RealtimeKit for scheduling #364
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
Allow super privileged containers to use RealtimeKit for scheduling #364
Conversation
Toolbx containers are super privileged containers [1,2], because they use the host's cgroup, IPC, network and PID namespaces, and turn off SELinux label separation. It's likely that users will want to use PipeWire inside Toolbx containers because they need some form of audio or video, and PipeWire needs to be able to use RealtimeKit to change the CPU priority of processes using these D-Bus interfaces: * org.freedesktop.RealtimeKit1.MakeThreadHighPriorityWithPID * org.freedesktop.RealtimeKit1.MakeThreadRealtimeWithPID If the SELinux policy blocks the processes inside super privileged containers from using RealtimeKit, then it will lead to: type=AVC msg=audit(1721340769.363:269): avc: denied { setsched } for pid=762 comm="rtkit-daemon" scontext=system_u:system_r:rtkit_daemon_t:s0 tcontext=unconfined_u:unconfined_r:spc_t:s0 tclass=process permissive=0 [1] https://developers.redhat.com/blog/2014/11/06/introducing-a-super-privileged-container-concept [2] https://danwalsh.livejournal.com/74754.html Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2298800 Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
Reviewer's Guide by SourceryThis pull request modifies the SELinux policy to allow processes within super privileged containers (specifically those labeled with No diagrams generated as the changes look simple and do not need a visual representation. 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 @debarshiray - I've reviewed your changes - here's some feedback:
Overall Comments:
- It would be helpful to add a comment to the code explaining why this change is necessary.
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.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: debarshiray, rhatdan 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 |
Thanks for the review, @rhatdan ! |
@debarshiray is it possible to include a bats test for this case, maybe in the toolbox repo such that we could run it here on container-selinux CI? |
Yes, it should be possible. I will add one. I need to figure out the best way to check for the SELinux denials from the tests. |
/cherrpick rhaos-maint |
Toolbx containers are super privileged containers [1,2], because they use the host's cgroup, IPC, network and PID namespaces, and turn off SELinux label separation. It's likely that users will want to use PipeWire inside Toolbx containers because they need some form of audio or video, and PipeWire needs to be able to use RealtimeKit to change the CPU priority of processes using these D-Bus interfaces:
org.freedesktop.RealtimeKit1.MakeThreadHighPriorityWithPID
org.freedesktop.RealtimeKit1.MakeThreadRealtimeWithPID
If the SELinux policy blocks the processes inside super privileged containers from using RealtimeKit, then it will lead to:
[1] https://developers.redhat.com/blog/2014/11/06/introducing-a-super-privileged-container-concept
[2] https://danwalsh.livejournal.com/74754.html
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2298800
Summary by Sourcery
Bug Fixes: