Files
linux/arch/powerpc/kernel
Milton Miller 6bc8282ee6 powerpc/vdso: Fix vdso cpu truncation
[ Upstream commit a9f675f950 ]

The code in vdso_cpu_init that exposes the cpu and numa node to
userspace via SPRG_VDSO incorrctly masks the cpu to 12 bits. This means
that any kernel running on a box with more than 4096 threads (NR_CPUS
advertises a limit of of 8192 cpus) would expose userspace to two cpu
contexts running at the same time with the same cpu number.

Note: I'm not aware of any distro shipping a kernel with support for more
than 4096 threads today, nor of any system image that currently exceeds
4096 threads. Found via code browsing.

Fixes: 18ad51dd34 ("powerpc: Add VDSO version of getcpu")
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200715233704.1352257-1-anton@ozlabs.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-16 08:46:40 +09:00
..
2023-05-15 16:17:15 +09:00
2023-05-15 16:17:15 +09:00
2023-05-15 16:17:15 +09:00
2007-05-11 05:38:25 -04:00
2016-06-14 13:58:26 +10:00
2016-06-21 15:30:56 +10:00
2014-11-27 09:32:58 +11:00
2016-08-07 23:50:09 -04:00
2016-08-07 23:50:09 -04:00
2015-08-06 15:10:20 +10:00
2011-03-31 11:26:23 -03:00
2016-08-07 23:50:09 -04:00
2015-03-24 13:15:52 +11:00
2016-07-15 14:57:47 +10:00
2011-03-31 11:26:23 -03:00
2023-05-15 16:07:05 +09:00
2016-06-14 13:58:26 +10:00
2015-04-07 17:15:13 +10:00
2023-05-16 08:46:40 +09:00
2023-05-15 17:10:35 +09:00