{
  "slug": "memfd-create",
  "term": "Linux memfd_create",
  "aliases": [
    "memfd",
    "memfd_create()"
  ],
  "definition": "Linux memfd_create() creates an anonymous volatile file and returns a descriptor for file operations and memory mapping.",
  "note": "Lifetime: the name is a diagnostic label, not a pathname or unique identity. The object survives while references remain, including mappings after the original descriptor closes. [memfd-api]\n\nSharing: a descriptor can be passed to another process. File seals constrain operations on the underlying object when sealing is enabled. Explicit MFD_ALLOW_SEALING avoids relying on the default seal set. MFD_NOEXEC_SEAL explicitly creates a non-executable object and implies MFD_ALLOW_SEALING; its initial F_SEAL_EXEC prevents changing execute bits. Creation defaults depend on kernel execution policy. [seals-kernel] [memfd-noexec]\n\nBacking: the ordinary implementation uses shmem rather than a persistent filesystem file. Volatile does not mean that every page stays in physical RAM, since tmpfs can use swap. [seals-kernel] [tmpfs-doc]",
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-18",
  "advantages": [
    "A descriptor can identify a shared buffer without a named temporary-file lifecycle."
  ],
  "limitations": [
    "Creation may be restricted by kernel configuration, system policy or sandbox rules."
  ],
  "related": [
    "file-sealing",
    "memory-mapped-file",
    "open-file-description",
    "copy-on-write"
  ],
  "citations": [
    {
      "id": "memfd-api",
      "title": "Linux man-pages: memfd_create(2)",
      "url": "https://man7.org/linux/man-pages/man2/memfd_create.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "seals-kernel",
      "title": "Linux v6.12: memfd sealing implementation",
      "url": "https://github.com/torvalds/linux/blob/v6.12/mm/memfd.c",
      "accessed": "2026-10-17"
    },
    {
      "id": "memfd-noexec",
      "title": "Linux kernel: non-executable memfd policy",
      "url": "https://docs.kernel.org/userspace-api/mfd_noexec.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "tmpfs-doc",
      "title": "Linux kernel: tmpfs and swap",
      "url": "https://docs.kernel.org/filesystems/tmpfs.html",
      "accessed": "2026-10-17"
    }
  ],
  "provenance": [
    "The companion experiment uses explicit MFD_NOEXEC_SEAL on Linux 6.8, not every kernel's default execution policy.",
    "No durability, no-swap or secret-memory property is implied."
  ]
}
