#include <linux/fs.h>
#include <linux/vfs.h>
#include <linux/pagemap.h>
#include <linux/file.h>
#include <linux/mm.h>
#include <linux/sched/signal.h>
#include <linux/khugepaged.h>
#include <linux/syscalls.h>
#include <linux/hugetlb.h>
#include <linux/shmem_fs.h>
#include <linux/memfd.h>
#include <linux/pid_namespace.h>
#include <uapi/linux/memfd.h>
#define MEMFD_TAG_PINNED …
#define LAST_SCAN …
static bool memfd_folio_has_extra_refs(struct folio *folio)
{ … }
static void memfd_tag_pins(struct xa_state *xas)
{ … }
struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx)
{ … }
static int memfd_wait_for_pins(struct address_space *mapping)
{ … }
static unsigned int *memfd_file_seals_ptr(struct file *file)
{ … }
#define F_ALL_SEALS …
static int memfd_add_seals(struct file *file, unsigned int seals)
{ … }
static int memfd_get_seals(struct file *file)
{ … }
long memfd_fcntl(struct file *file, unsigned int cmd, unsigned int arg)
{ … }
#define MFD_NAME_PREFIX …
#define MFD_NAME_PREFIX_LEN …
#define MFD_NAME_MAX_LEN …
#define MFD_ALL_FLAGS …
static int check_sysctl_memfd_noexec(unsigned int *flags)
{ … }
SYSCALL_DEFINE2(memfd_create,
const char __user *, uname,
unsigned int, flags)
{ … }