Re: [PATCH] fs/proc: Expose mm_cpumask in /proc/[pid]/status
From: Aaron Tomlin
Date: Thu Dec 18 2025 - 21:06:43 EST
On Thu, Dec 18, 2025 at 09:30:53AM +0100, David Hildenbrand (Red Hat) wrote:
> I agree with Oleg's comments.
>
> Given that everybody has read access to /proc/$PID/status IIUC, I wonder if
> that information could somehow help an attacker to better attack a target
> program (knowing which CPUs have dirty TLB etc). As you saise, it's
> primarily for TLB and cache sync ...
>
> Just a thought, have nothing concrete in mind.
Hi David,
Thank you for raising this point; security and information leakage are,
quite rightly, paramount considerations when adding new entries to
world-readable interfaces like /proc/[pid]/status. Upon reflection, I
submit that the risk here is minimal for a few reasons:
1. Existing Visibility: The kernel already exposes a significant amount
of CPU residency information. For instance, /proc/[pid]/stat explicitly
shows the CPU a task is currently running on (field 39)
i.e., task_cpu(task), and "Cpus_allowed" already defines the bounds of
where a task can be. See do_task_stat().
2. Resolution of Data: The mm_cpumask is a relatively coarse-grained
diagnostic. While it indicates where TLB entries might be valid, it
does not provide the fine-grained timing or cache-line information
typically required for sophisticated side-channel attacks.
3. Diagnostic Value: The primary intent is to provide visibility into
the "memory footprint" across CPUs, which is invaluable for debugging
performance issues related to IPI storms and TLB shootdowns in
large-scale NUMA systems. The CPU-affinity sets the boundary; the
mm_cpumask records the arrival; they complement each other.
I trust that the diagnostic utility is seen to outweigh the theoretical
risk in this instance.
Kind regards,
--
Aaron Tomlin
Attachment:
signature.asc
Description: PGP signature