[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241206101110.1646108-12-kevin.brodsky@arm.com>
Date: Fri, 6 Dec 2024 10:11:05 +0000
From: Kevin Brodsky <kevin.brodsky@....com>
To: linux-hardening@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Kevin Brodsky <kevin.brodsky@....com>,
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: [RFC PATCH 11/16] arm64: kpkeys: Support KPKEYS_LVL_PGTABLES
Enable RW access to KPKEYS_PKEY_PGTABLES (used to map page table
pages) if switching to KPKEYS_LVL_PGTABLES, otherwise only grant RO
access.
Signed-off-by: Kevin Brodsky <kevin.brodsky@....com>
---
arch/arm64/include/asm/kpkeys.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/include/asm/kpkeys.h b/arch/arm64/include/asm/kpkeys.h
index e17f6df41873..4854e1f3babd 100644
--- a/arch/arm64/include/asm/kpkeys.h
+++ b/arch/arm64/include/asm/kpkeys.h
@@ -18,6 +18,8 @@ static inline bool arch_kpkeys_enabled(void)
static inline u64 por_set_kpkeys_level(u64 por, int level)
{
por = por_set_pkey_perms(por, KPKEYS_PKEY_DEFAULT, POE_RXW);
+ por = por_set_pkey_perms(por, KPKEYS_PKEY_PGTABLES,
+ level == KPKEYS_LVL_PGTABLES ? POE_RW : POE_R);
return por;
}
--
2.47.0
Powered by blists - more mailing lists