Thread (29 messages) 29 messages, 3 authors, 2024-12-11

Re: [RFC PATCH 08/16] mm: Introduce kernel_pgtables_set_pkey()

From: Peter Zijlstra <peterz@infradead.org>
Date: 2024-12-09 10:03:41
Also in: linux-hardening, lkml

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 <redacted>
---

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help