]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: amu: Delay allocating cpumask for AMU FIE support
authorBeata Michalska <beata.michalska@arm.com>
Fri, 31 Jan 2025 15:58:42 +0000 (15:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:17 +0000 (12:54 -0700)
commitaa3b0ea4742ade55b00a57e10b3dda87d40bceb4
tree173d3b4ab7966f296ffaa76d52e221c8f1e72df3
parent8aa4c89378ed584deef1a905340a6ad425af57be
arm64: amu: Delay allocating cpumask for AMU FIE support

[ Upstream commit d923782b041218ef3804b2fed87619b5b1a497f3 ]

For the time being, the amu_fie_cpus cpumask is being exclusively used
by the AMU-related internals of FIE support and is guaranteed to be
valid on every access currently made. Still the mask is not being
invalidated on one of the error handling code paths, which leaves
a soft spot with theoretical risk of UAF for CPUMASK_OFFSTACK cases.
To make things sound, delay allocating said cpumask
(for CPUMASK_OFFSTACK) avoiding otherwise nasty sanitising case failing
to register the cpufreq policy notifications.

Signed-off-by: Beata Michalska <beata.michalska@arm.com>
Reviewed-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20250131155842.3839098-1-beata.michalska@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/kernel/topology.c