Files
twx-linux/arch/powerpc/kernel
Christophe Leroy c8914d1ceb powerpc/vdso: Fix VDSO data access when running in a non-root time namespace
[ Upstream commit c73049389e ]

When running in a non-root time namespace, the global VDSO data page
is replaced by a dedicated namespace data page and the global data
page is mapped next to it. Detailed explanations can be found at
commit 660fd04f93 ("lib/vdso: Prepare for time namespace support").

When it happens, __kernel_get_syscall_map and __kernel_get_tbfreq
and __kernel_sync_dicache don't work anymore because they read 0
instead of the data they need.

To address that, clock_mode has to be read. When it is set to
VDSO_CLOCKMODE_TIMENS, it means it is a dedicated namespace data page
and the global data is located on the following page.

Add a macro called get_realdatapage which reads clock_mode and add
PAGE_SIZE to the pointer provided by get_datapage macro when
clock_mode is equal to VDSO_CLOCKMODE_TIMENS. Use this new macro
instead of get_datapage macro except for time functions as they handle
it internally.

Fixes: 74205b3fc2 ("powerpc/vdso: Add support for time namespaces")
Reported-by: Jason A. Donenfeld <Jason@zx2c4.com>
Closes: https://lore.kernel.org/all/ZtnYqZI-nrsNslwy@zx2c4.com/
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-10 12:03:44 +02:00
..
2024-05-08 00:21:30 +10:00
2023-10-01 23:09:02 +11:00
2023-10-10 13:35:55 -06:00
2024-06-28 22:28:47 +10:00
2024-06-28 22:28:48 +10:00
2024-06-28 22:28:48 +10:00
2024-06-28 22:28:47 +10:00
2024-06-28 22:28:47 +10:00
2024-05-08 00:21:30 +10:00
2023-10-10 13:35:55 -06:00
2024-03-03 22:20:29 +11:00
2024-05-08 00:21:30 +10:00
2024-05-08 00:21:30 +10:00
2024-06-28 22:28:48 +10:00
2024-06-28 22:28:47 +10:00
2024-06-28 22:28:47 +10:00