#define pr_fmt(fmt) …
#include <linux/security.h>
#include <linux/cred.h>
#include "lsm.h"
static DEFINE_MUTEX(uid_policy_update_lock);
static DEFINE_MUTEX(gid_policy_update_lock);
static int parse_policy_line(struct file *file, char *buf,
struct setid_rule *rule)
{ … }
static void __release_ruleset(struct rcu_head *rcu)
{ … }
static void release_ruleset(struct setid_ruleset *pol){ … }
static void insert_rule(struct setid_ruleset *pol, struct setid_rule *rule)
{ … }
static int verify_ruleset(struct setid_ruleset *pol)
{ … }
static ssize_t handle_policy_update(struct file *file,
const char __user *ubuf, size_t len, enum setid_type policy_type)
{ … }
static ssize_t safesetid_uid_file_write(struct file *file,
const char __user *buf,
size_t len,
loff_t *ppos)
{ … }
static ssize_t safesetid_gid_file_write(struct file *file,
const char __user *buf,
size_t len,
loff_t *ppos)
{ … }
static ssize_t safesetid_file_read(struct file *file, char __user *buf,
size_t len, loff_t *ppos, struct mutex *policy_update_lock, struct __rcu setid_ruleset* ruleset)
{ … }
static ssize_t safesetid_uid_file_read(struct file *file, char __user *buf,
size_t len, loff_t *ppos)
{ … }
static ssize_t safesetid_gid_file_read(struct file *file, char __user *buf,
size_t len, loff_t *ppos)
{ … }
static const struct file_operations safesetid_uid_file_fops = …;
static const struct file_operations safesetid_gid_file_fops = …;
static int __init safesetid_init_securityfs(void)
{ … }
fs_initcall(safesetid_init_securityfs);