Skip to content

Conversation

@ctalledo
Copy link
Collaborator

@ctalledo ctalledo commented Feb 28, 2025

- What I did

Mask Linux thermal interrupt info inside a container's /proc and /sys.

Mitigates the use of thermal event interrupt information (available within the container via /proc/interrupts or /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/interrupts and /sys/devices/system/cpu/<cpuX>/thermal_throttle inside 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

docker run -it --rm alpine sh -c "cat /proc/interrupts"
docker run -it --rm alpine sh -c "cat /sys/devices/system/cpu/cpu0/thermal_throttle"

Should each return an empty file.

- Human readable description for the release notes

Mask Linux thermal interrupt info in a container's `/proc` and `/sys` by default. Mitigates potential [Thermal Side-Channel Vulnerability Exploit](https://github.com/moby/moby/security/advisories/GHSA-6fw5-f8r9-fgfm).

- A picture of a cute animal (not mandatory but encouraged)

// 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 {
Copy link
Contributor

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? 🤔

Copy link
Collaborator Author

@ctalledo ctalledo Feb 28, 2025

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).

Copy link
Member

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

Copy link
Collaborator Author

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).

Copy link
Collaborator Author

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.

Copy link
Contributor

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.

Copy link
Collaborator Author

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/platform already has a NumProcs() function.

  • Package internal/platform also has an Architecture() 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.

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]>
@ctalledo ctalledo force-pushed the mask-thermal-interrupt-info branch from 6d3a73e to a3fef5d Compare March 11, 2025 00:18
@vvoland vvoland added the kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. label Mar 12, 2025
@vvoland vvoland requested a review from thaJeztah March 12, 2025 16:43
@ctalledo
Copy link
Collaborator Author

@thaJeztah: could I please get your approval for this PR (assuming it's all good)? Thanks!

@vvoland vvoland requested a review from robmry March 13, 2025 15:12
Copy link
Contributor

@robmry robmry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@robmry robmry merged commit 97c3971 into moby:master Mar 13, 2025
155 checks passed
@ctalledo ctalledo deleted the mask-thermal-interrupt-info branch March 13, 2025 16:02
Copy link
Member

@thaJeztah thaJeztah left a 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

giuseppe added a commit to giuseppe/common that referenced this pull request Mar 20, 2025
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]>
giuseppe added a commit to giuseppe/common that referenced this pull request Mar 20, 2025
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]>
giuseppe added a commit to giuseppe/common that referenced this pull request Mar 20, 2025
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]>
giuseppe added a commit to giuseppe/common that referenced this pull request Mar 20, 2025
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]>
giuseppe added a commit to giuseppe/common that referenced this pull request Mar 20, 2025
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]>
giuseppe added a commit to giuseppe/common that referenced this pull request Mar 20, 2025
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]>
giuseppe added a commit to giuseppe/common that referenced this pull request Mar 20, 2025
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]>
giuseppe added a commit to giuseppe/common that referenced this pull request Mar 20, 2025
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]>
giuseppe added a commit to giuseppe/common that referenced this pull request Mar 20, 2025
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]>
saschagrunert added a commit to saschagrunert/kubernetes that referenced this pull request Mar 24, 2025
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]>
saschagrunert added a commit to saschagrunert/kubernetes that referenced this pull request Mar 24, 2025
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]>
taylorsilva added a commit to concourse/concourse that referenced this pull request Mar 25, 2025
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]>
saschagrunert added a commit to saschagrunert/kubernetes that referenced this pull request Jul 16, 2025
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]>
saschagrunert added a commit to saschagrunert/kubernetes that referenced this pull request Jul 16, 2025
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]>
saschagrunert added a commit to saschagrunert/kubernetes that referenced this pull request Jul 16, 2025
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]>
saschagrunert added a commit to saschagrunert/kubernetes that referenced this pull request Jul 16, 2025
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]>
saschagrunert added a commit to saschagrunert/kubernetes that referenced this pull request Jul 16, 2025
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]>
saschagrunert added a commit to saschagrunert/kubernetes that referenced this pull request Jul 16, 2025
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]>
hswong3i pushed a commit to alvistack/kubernetes-kubernetes that referenced this pull request Sep 10, 2025
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]>
hswong3i pushed a commit to alvistack/kubernetes-kubernetes that referenced this pull request Sep 10, 2025
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/runtime Runtime impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. process/cherry-pick/23.0 process/cherry-pick/25.0 status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants