[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19f6a089-caa8-4d91-951a-d9a25e05ba94@csgroup.eu>
Date: Fri, 6 Sep 2024 14:31:29 +0200
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Michael Ellerman <mpe@...erman.id.au>,
"Jason A . Donenfeld" <Jason@...c4.com>
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Nicholas Piggin <npiggin@...il.com>, Naveen N Rao <naveen@...nel.org>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Andrei Vagin <avagin@...il.com>
Subject: Re: [PATCH 1/2] powerpc/vdso: Fix VDSO data access when running in a
non-root time namespace
Le 06/09/2024 à 14:23, Michael Ellerman a écrit :
> Christophe Leroy <christophe.leroy@...roup.eu> writes:
>> 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 660fd04f9317 ("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: 74205b3fc2ef ("powerpc/vdso: Add support for time namespaces")
>> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
>
> Oops.
>
> I guess it should also have:
>
> Cc: stable@...r.kernel.org # v5.13+
> Reported-by: Jason A. Donenfeld <Jason@...c4.com>
> Closes: https://lore.kernel.org/all/ZtnYqZI-nrsNslwy@zx2c4.com/
Jason only reported a problem with getrandom, the other three are
"cherry on the cake".
The bug has been there for 3 years, I'm sure it can stay 3-4 more weeks,
I'm not sure there is a need to apply it in both trees.
As far as I understood Jason was about to squash the fix into his tree
so I was expecting him to apply patch 1 before "vDSO getrandom
implementation for powerpc" patches and then squash patch 2 in place.
>
> Jason how do you want to handle this?
>
> I can put patch 1 in a topic branch that we both merge? Then you can
> apply patch 2 on top of that merge in your tree.
>
> Or we could both apply patch 1 to our trees, it might lead to a conflict
> but it wouldn't be anything drastic.
Powered by blists - more mailing lists