[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241206101110.1646108-3-kevin.brodsky@arm.com>
Date: Fri, 6 Dec 2024 10:10:56 +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 02/16] set_memory: Introduce set_memory_pkey() stub
Introduce a new function, set_memory_pkey(), which sets the
protection key (pkey) of pages in the specified linear mapping
range. Architectures implementing kernel pkeys (kpkeys) must
provide a suitable implementation; an empty stub is added as
fallback.
Signed-off-by: Kevin Brodsky <kevin.brodsky@....com>
---
include/linux/set_memory.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/set_memory.h b/include/linux/set_memory.h
index 3030d9245f5a..7b3a8bfde3c6 100644
--- a/include/linux/set_memory.h
+++ b/include/linux/set_memory.h
@@ -84,4 +84,11 @@ static inline int set_memory_decrypted(unsigned long addr, int numpages)
}
#endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
+#ifndef CONFIG_ARCH_HAS_KPKEYS
+static inline int set_memory_pkey(unsigned long addr, int numpages, int pkey)
+{
+ return 0;
+}
+#endif
+
#endif /* _LINUX_SET_MEMORY_H_ */
--
2.47.0
Powered by blists - more mailing lists