Linux Secret Memory "secretmemfd" System Call Remains Under Review

Written by Michael Larabel in Linux Kernel on 20 July 2020 at 07:21 AM EDT. 14 Comments
A few months back we wrote of experimental work for creating "secret" memory areas with memfd and now that work has turned into the secretmemfd system call that is under review.

The motivation for this work is for creating memory areas from user-space that are only visible to the process owning said memory and is not mapped for other processes or the kernel page tables. One use-case mentioned in the past was for OpenSSL usage with these secret memory areas for the storing of private keys.

Mike Rapoport of IBM sent out a set of six patches on Monday morning for introducing the secretmemfd system call as the latest on this front for secret memory areas.

Rapoport explained, "The file descriptor is created using a dedicated secretmemfd system call. The desired protection mode for the memory is configured using flags parameter of the system call. The mmap() of the file descriptor created with secretmemfd() will create a "secret" memory mapping. The pages in that mapping will be marked as not present in the direct map and will have desired protection bits set in the user page table. For instance, current implementation allows uncached mappings. Although normally Linux userspace mappings are protected from other users, such secret mappings are useful for environments where a hostile tenant is trying to trick the kernel into giving them access to other tenants mappings. Additionally, the secret mappings may be used as a mean to protect guest memory in a virtual machine host."

These latest secret memory patches can be found on the kernel mailing list.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week