#define pr_fmt(fmt) "LoadPin: " fmt
#include <linux/module.h>
#include <linux/lsm_hooks.h>
#include <linux/string_helpers.h>
static void report_load(const char *origin, struct file *file, char *operation)
char *cmdline, *pathname;
pathname = kstrdup_quotable_file(file, GFP_KERNEL);
cmdline = kstrdup_quotable_cmdline(current, GFP_KERNEL);
pr_notice("%s %s obj=%s%s%s pid=%d cmdline=%s%s%s\n",
(pathname && pathname[0] != '<') ? "\"" : "",
(pathname && pathname[0] != '<') ? "\"" : "",
cmdline ? "\"" : "", cmdline, cmdline ? "\"" : "");
static int enforce = IS_ENABLED(CONFIG_SECURITY_LOADPIN_ENFORCE);
static struct super_block *pinned_root;
static DEFINE_SPINLOCK(pinned_root_spinlock);
static struct ctl_path loadpin_sysctl_path[] = {
{ .procname = "kernel", },
{ .procname = "loadpin", },
static struct ctl_table loadpin_sysctl_table[] = {