-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Mask Linux thermal interrupt info in /proc and /sys. #49560
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
| // larger to the number of CPUs currently online). The returned set may be a | ||
| // single CPU number ({0}), or a continuous range of CPU numbers ({0,1,2,3}), or | ||
| // a non-continuous range of CPU numbers ({0,1,2,3,12,13,14,15}). | ||
| func PossibleCPU() []int { |
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 sure if internal/platform is the best package for this.
In general we refer to "platform" in the context of an image (OS, architecture, variant, ...) instead of the running system.
Perhaps internal/system would be more appropriate? 🤔
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.
Pushing back a bit: platform generally means the underlying hw environment the software is running on, so the number of CPUs falls within that category.
Having said that, if you feel strongly about it, I can create a separate internal/system package, though doing so may raise confusion since we already have a pkg/system package (where PossibleCPU() would not fit well IMO).
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.
Given that there's only a single consumer of this function, the easy way out could be to move these files inside the oci packages, and un-export the possibleCPU() function
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 think it fits well in internal/platform, as opposed to hiding it within the oci package (where it really does not fit, even though it's the only consumer currently).
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.
Hi @thaJeztah, @vvoland, any further feedback on this PR? I would like to merge it if possible.
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.
platform generally means the underlying hw environment the software is running on, so the number of CPUs falls within that category.
Right, but in our context (container runtime), platform has a more specific meaning.
How about putting it in a cpu/cpus package? We could then rename the function name to just Possible (so it would make it cpu.Possible.
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.
How about putting it in a cpu/cpus package?
We could do that but notice that:
-
Package
internal/platformalready has a NumProcs() function. -
Package
internal/platformalso has anArchitecture()function which is a property of the CPU.
In other words, there's no clear difference between platform and cpu currently, so I would vote to simplify and keep it all under the platform package.
24dd26c to
6d3a73e
Compare
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Signed-off-by: Cesar Talledo <[email protected]>
6d3a73e to
a3fef5d
Compare
|
@thaJeztah: could I please get your approval for this PR (assuming it's all good)? Thanks! |
robmry
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
thaJeztah
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
sorry, was waiting for that discussion that was happening; code looks good
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/*/thermal_throttle" inside containers by default. It is the equivalent of moby/moby#49560 for Moby. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Signed-off-by: Giuseppe Scrivano <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/*/thermal_throttle" inside containers by default. It is the equivalent of moby/moby#49560 for Moby. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Signed-off-by: Giuseppe Scrivano <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/*/thermal_throttle" inside containers by default. It is the equivalent of moby/moby#49560 for Moby. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Signed-off-by: Giuseppe Scrivano <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/*/thermal_throttle" inside containers by default. It is the equivalent of moby/moby#49560 for Moby. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Signed-off-by: Giuseppe Scrivano <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/*/thermal_throttle" inside containers by default. It is the equivalent of moby/moby#49560 for Moby. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Signed-off-by: Giuseppe Scrivano <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/*/thermal_throttle" inside containers by default. It is the equivalent of moby/moby#49560 for Moby. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Signed-off-by: Giuseppe Scrivano <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/*/thermal_throttle" inside containers by default. It is the equivalent of moby/moby#49560 for Moby. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Signed-off-by: Giuseppe Scrivano <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/*/thermal_throttle" inside containers by default. It is the equivalent of moby/moby#49560 for Moby. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Signed-off-by: Giuseppe Scrivano <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/*/thermal_throttle" inside containers by default. It is the equivalent of moby/moby#49560 for Moby. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Signed-off-by: Giuseppe Scrivano <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Refers to moby/moby#49560 Signed-off-by: Sascha Grunert <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Refers to moby/moby#49560 Signed-off-by: Sascha Grunert <[email protected]>
This is following upstream Docker/Podman, specifically following Podman's implementation by pulling in github.com/containers/common. That repo appears to be a shared library among all their other projects. We could potentially simplify some of our container creation behaviour by leveraging more of that package in our own runtime code. For now we're pulling in the lists of masked and readonly paths that they also use for unprivileged containers. They appear to follow whatever Docker does, so this keeps us inline with what the overall container community expects for non-privileged containers. Motivation for this change came from this Docker PR: moby/moby#49560 Which was detected by our pipeline job that checks for new docker mounts in privileged and non-privileged containers. Signed-off-by: Taylor Silva <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Refers to moby/moby#49560 Signed-off-by: Sascha Grunert <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Refers to moby/moby#49560 Signed-off-by: Sascha Grunert <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Refers to moby/moby#49560 Signed-off-by: Sascha Grunert <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Refers to moby/moby#49560 Signed-off-by: Sascha Grunert <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Refers to moby/moby#49560 Signed-off-by: Sascha Grunert <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Refers to moby/moby#49560 Signed-off-by: Sascha Grunert <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Refers to moby/moby#49560 Signed-off-by: Sascha Grunert <[email protected]>
On Linux, mask "/proc/interrupts" and "/sys/devices/system/cpu/cpu<x>/thermal_throttle" inside containers by default. Privileged containers or containers started with --security-opt="systempaths=unconfined" are not affected. Mitigates potential Thermal Side-Channel Vulnerability Exploit (https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm). Also: improve integration test TestCreateWithCustomMaskedPaths() to ensure default masked paths don't apply to privileged containers. Refers to moby/moby#49560 Signed-off-by: Sascha Grunert <[email protected]>
- What I did
Mask Linux thermal interrupt info inside a container's
/procand/sys.Mitigates the use of thermal event interrupt information (available within the container via
/proc/interruptsor/sys/devices/system/cpu/<cpuX>/thermal_throttle/) to perform thermal side channel attacks.Big thanks to @zhangxin00 for reporting this issue.
- How I did it
Mask
/proc/interruptsand/sys/devices/system/cpu/<cpuX>/thermal_throttleinside containers by default. Privileged containers or containers started with--security-opt="systempaths=unconfined"are not affected.Integration test
TestCreateWithCustomMaskedPaths()was updated with the new masked paths and improved to ensure the default masked paths don't apply to privileged containers.- How to verify it
Should each return an empty file.
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)