linux/mm/secretmem.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright IBM Corporation, 2021
 *
 * Author: Mike Rapoport <[email protected]>
 */

#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/swap.h>
#include <linux/mount.h>
#include <linux/memfd.h>
#include <linux/bitops.h>
#include <linux/printk.h>
#include <linux/pagemap.h>
#include <linux/syscalls.h>
#include <linux/pseudo_fs.h>
#include <linux/secretmem.h>
#include <linux/set_memory.h>
#include <linux/sched/signal.h>

#include <uapi/linux/magic.h>

#include <asm/tlbflush.h>

#include "internal.h"

#undef pr_fmt
#define pr_fmt(fmt)

/*
 * Define mode and flag masks to allow validation of the system call
 * parameters.
 */
#define SECRETMEM_MODE_MASK
#define SECRETMEM_FLAGS_MASK

static bool secretmem_enable __ro_after_init =;
module_param_named(enable, secretmem_enable, bool, 0400);
MODULE_PARM_DESC();

static atomic_t secretmem_users;

bool secretmem_active(void)
{}

static vm_fault_t secretmem_fault(struct vm_fault *vmf)
{}

static const struct vm_operations_struct secretmem_vm_ops =;

static int secretmem_release(struct inode *inode, struct file *file)
{}

static int secretmem_mmap(struct file *file, struct vm_area_struct *vma)
{}

bool vma_is_secretmem(struct vm_area_struct *vma)
{}

static const struct file_operations secretmem_fops =;

static int secretmem_migrate_folio(struct address_space *mapping,
		struct folio *dst, struct folio *src, enum migrate_mode mode)
{}

static void secretmem_free_folio(struct folio *folio)
{}

const struct address_space_operations secretmem_aops =;

static int secretmem_setattr(struct mnt_idmap *idmap,
			     struct dentry *dentry, struct iattr *iattr)
{}

static const struct inode_operations secretmem_iops =;

static struct vfsmount *secretmem_mnt;

static struct file *secretmem_file_create(unsigned long flags)
{}

SYSCALL_DEFINE1(memfd_secret, unsigned int, flags)
{}

static int secretmem_init_fs_context(struct fs_context *fc)
{}

static struct file_system_type secretmem_fs =;

static int __init secretmem_init(void)
{}
fs_initcall(secretmem_init);