[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <accd59bd-27ff-4a22-b3a5-c2705a0db075@arm.com>
Date: Tue, 10 Dec 2024 10:27:35 +0100
From: Kevin Brodsky <kevin.brodsky@....com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org,
aruna.ramakrishna@...cle.com, broonie@...nel.org, catalin.marinas@....com,
dave.hansen@...ux.intel.com, jannh@...gle.com, jeffxu@...omium.org,
joey.gouly@....com, kees@...nel.org, maz@...nel.org,
pierre.langlois@....com, qperret@...gle.com, ryan.roberts@....com,
will@...nel.org, linux-arm-kernel@...ts.infradead.org, x86@...nel.org
Subject: Re: [RFC PATCH 08/16] mm: Introduce kernel_pgtables_set_pkey()
On 09/12/2024 11:03, Peter Zijlstra wrote:
> On Fri, Dec 06, 2024 at 10:11:02AM +0000, Kevin Brodsky wrote:
>> kernel_pgtables_set_pkey() allows setting the pkey of all page table
>> pages in swapper_pg_dir, recursively. This will be needed by
>> kpkeys_hardened_pgtables, as it relies on all PTPs being mapped with
>> a non-default pkey. Those initial kernel page tables cannot
>> practically be assigned a non-default pkey right when they are
>> allocated, so mutating them during (early) boot is required.
>>
>> Signed-off-by: Kevin Brodsky <kevin.brodsky@....com>
>> ---
>>
>> It feels that some sort of locking is called for in
>> kernel_pgtables_set_pkey(), but I couldn't figure out what would be
>> appropriate.
> init_mm.page_table_lock is typically the one used to serialize kernel
> page tables IIRC.
That does seem to be the case, thanks! Hopefully holding that spinlock
for the entire duration of the loop in kernel_pgtables_set_pkey() won't
be an issue.
- Kevin
Powered by blists - more mailing lists