Re: [PATCH v5 3/5] mm: introduce memfd_secret system call to create "secret" memory areas

From
Randy Dunlap <rdunlap@infradead.org>
Date
2020-09-16 21:06:51
Also in
linux-arch, linux-arm-kernel, linux-fsdevel, linux-mm, linux-riscv, lkml, nvdimm
Reply to
Mike Rapoport, 2020-09-16
Hi Mike,


On 9/16/20 12:35 AM, Mike Rapoport wrote:
quoted hunk ↗ jump to hunk
From: Mike Rapoport <redacted>


Signed-off-by: Mike Rapoport <redacted>
---
 arch/Kconfig                   |   7 +
 arch/x86/Kconfig               |   1 +
 include/uapi/linux/magic.h     |   1 +
 include/uapi/linux/secretmem.h |   8 +
 kernel/sys_ni.c                |   2 +
 mm/Kconfig                     |   4 +
 mm/Makefile                    |   1 +
 mm/secretmem.c                 | 264 +++++++++++++++++++++++++++++++++
 8 files changed, 288 insertions(+)
 create mode 100644 include/uapi/linux/secretmem.h
 create mode 100644 mm/secretmem.c
diff --git a/arch/Kconfig b/arch/Kconfig
index af14a567b493..8d161bd4142d 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -975,6 +975,13 @@ config HAVE_SPARSE_SYSCALL_NR
 config ARCH_HAS_VDSO_DATA
 	bool
 
+config HAVE_SECRETMEM_UNCACHED
+       bool
+       help
+          An architecture can select this if its semantics of non-cached
+          mappings can be used to prevent speculative loads and it is
+          useful for secret protection.
Please use tabs instead of spaces for indentation.
quoted hunk ↗ jump to hunk
+
 source "kernel/gcov/Kconfig"
 
 source "scripts/gcc-plugins/Kconfig"
quoted hunk ↗ jump to hunk
diff --git a/mm/Kconfig b/mm/Kconfig
index 6c974888f86f..70cfc20d7caa 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -868,4 +868,8 @@ config ARCH_HAS_HUGEPD
 config MAPPING_DIRTY_HELPERS
         bool
 
+config SECRETMEM
+        def_bool ARCH_HAS_SET_DIRECT_MAP && !EMBEDDED
Use tab above for indentation.
quoted hunk ↗ jump to hunk
+	select GENERIC_ALLOCATOR
+
 endmenu

thanks.
-- 
~Randy
Thread (14 messages) 14 messages, 6 authors, last reply 2020-09-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help