Skip to content

RFC Multi-Key Total Memory Encryption API (MKTME)

Alison Schofield keyrings linux-mm linux-security-module 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest13 patches 77 repliesIn review
  2. v1 RFC12 patches 43 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13x86/mktme: Document the MKTME APIsDocumentation/x86/mktme/index.rst Documentation/x86/mktme/mktme_demo.rst Documentation/x86/mktme/mktme_encrypt.rst +2 more+291 -04 replies
2/13mm: Generalize the mprotect implementation to support extensionsmm/mprotect.c+6 -41 reply
3/13syscall/x86: Wire up a new system call for memory encryption keysarch/x86/entry/syscalls/syscall_32.tbl arch/x86/entry/syscalls/syscall_64.tbl include/linux/syscalls.h +2 more+9 -10 replies
4/13x86/mm: Add helper functions for MKTME memory encryption keysarch/x86/include/asm/mktme.h arch/x86/mm/mktme.c+103 -05 replies
5/13x86/mm: Set KeyIDs in encrypted VMAsarch/x86/include/asm/mktme.h arch/x86/mm/mktme.c include/linux/mm.h+36 -01 reply
6/13mm: Add the encrypt_mprotect() system callfs/exec.c include/linux/key.h include/linux/mm.h +1 more+62 -101 reply
7/13x86/mm: Add helpers for reference counting encrypted VMAsarch/x86/include/asm/mktme.h arch/x86/mm/mktme.c include/linux/mm.h+69 -02 replies
8/13mm: Use reference counting for encrypted VMAsarch/x86/mm/mktme.c kernel/fork.c+4 -00 replies
9/13mm: Restrict memory encryption to anonymous VMA'smm/mprotect.c+24 -03 replies
10/13keys/mktme: Add the MKTME Key Service type for memory encryptionarch/x86/Kconfig include/keys/mktme-type.h security/keys/Kconfig +2 more+393 -04 replies
11/13keys/mktme: Program memory encryption keys on a system wide basissecurity/keys/mktme_keys.c+60 -16 replies
12/13keys/mktme: Save MKTME data if kernel cmdline parameter allowsDocumentation/admin-guide/kernel-parameters.rst Documentation/admin-guide/kernel-parameters.txt arch/x86/mm/mktme.c +1 more+79 -06 replies
13/13keys/mktme: Support CPU Hotplug for MKTME keyssecurity/keys/mktme_keys.c+126 -94 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC v2 00/13] Multi-Key Total Memory Encryption API (MKTME)

Hi Thomas, David,

Here is an updated RFC on the API's to support MKTME. (Multi-Key Total Memory Encryption)

This RFC presents the 2 API additions to support the creation and usage of memory encryption keys:
1) Kernel Key Service type "mktme"
2) System call encrypt_mprotect()

This patchset is built upon Kirill Shutemov's work for the core MKTME support.

David: Please let me know if the changes made, based on your review, are reasonable. I don't think that the new changes touch key service specific areas (much).

Thomas: Please provide feedback on encrypt_mprotect(). If not a review, then a direction check would be helpful.

I picked up a few more 'CCs this time in get_maintainer!

Thanks!
Alison

Changes in RFC2
Add a preparser to mktme key service. (dhowells)
Replace key serial no. with key struct point in mktme_map. (dhowells) Remove patch that inserts a special MKTME case in keyctl revoke. (dhowells) Updated key usage syntax in the documentation (Kai)
Replaced NO_PKEY, NO_KEYID with a single constant NO_KEY. (Jarkko) Clarified comments in changelog and code. (Jarkko)
Add clear, no-encrypt, and update key support.
Add mktme_savekeys (Patch 12 ) to give kernel permission to save key data. Add cpu hotplug support. (Patch 13)

Alison Schofield (13):
x86/mktme: Document the MKTME APIs
mm: Generalize the mprotect implementation to support extensions syscall/x86: Wire up a new system call for memory encryption keys x86/mm: Add helper functions for MKTME memory encryption keys x86/mm: Set KeyIDs in encrypted VMAs
mm: Add the encrypt_mprotect() system call
x86/mm: Add helpers for reference counting encrypted VMAs
mm: Use reference counting for encrypted VMAs
mm: Restrict memory encryption to anonymous VMA's keys/mktme: Add the MKTME Key Service type for memory encryption keys/mktme: Program memory encryption keys on a system wide basis keys/mktme: Save MKTME data if kernel cmdline parameter allows keys/mktme: Support CPU Hotplug for MKTME keys

 Documentation/admin-guide/kernel-parameters.rst |   1 +
 Documentation/admin-guide/kernel-parameters.txt |  11 +
 Documentation/x86/mktme/index.rst               |  11 +
 Documentation/x86/mktme/mktme_demo.rst          |  53 +++
 Documentation/x86/mktme/mktme_encrypt.rst       |  58 +++
 Documentation/x86/mktme/mktme_keys.rst          | 109 +++++
 Documentation/x86/mktme/mktme_overview.rst      |  60 +++
 arch/x86/Kconfig                                |   1 +
 arch/x86/entry/syscalls/syscall_32.tbl          |   1 +
 arch/x86/entry/syscalls/syscall_64.tbl          |   1 +
 arch/x86/include/asm/mktme.h                    |  25 +
 arch/x86/mm/mktme.c                             | 179 ++++++++
 fs/exec.c                                       |   4 +-
 include/keys/mktme-type.h                       |  41 ++
 include/linux/key.h                             |   2 +
 include/linux/mm.h                              |  11 +-
 include/linux/syscalls.h                        |   2 +
 include/uapi/asm-generic/unistd.h               |   4 +-
 kernel/fork.c                                   |   2 +
 kernel/sys_ni.c                                 |   2 +
 mm/mprotect.c                                   |  91 +++-
 security/keys/Kconfig                           |  11 +
 security/keys/Makefile                          |   1 +
 security/keys/mktme_keys.c                      | 580 ++++++++++++++++++++++++
 24 files changed, 1249 insertions(+), 12 deletions(-)
 create mode 100644 Documentation/x86/mktme/index.rst
 create mode 100644 Documentation/x86/mktme/mktme_demo.rst
 create mode 100644 Documentation/x86/mktme/mktme_encrypt.rst
 create mode 100644 Documentation/x86/mktme/mktme_keys.rst
 create mode 100644 Documentation/x86/mktme/mktme_overview.rst
 create mode 100644 include/keys/mktme-type.h
 create mode 100644 security/keys/mktme_keys.c
Signature · 1 line
2.14.1