#include <asm/current.h>
#include <linux/cred.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/lsm_hooks.h>
#include <linux/rcupdate.h>
#include <linux/sched.h>
#include <net/af_unix.h>
#include <net/sock.h>
#include "common.h"
#include "cred.h"
#include "fs.h"
#include "ruleset.h"
#include "setup.h"
#include "task.h"
static bool domain_scope_le(const struct landlock_ruleset *const parent,
const struct landlock_ruleset *const child)
{ … }
static bool task_is_scoped(const struct task_struct *const parent,
const struct task_struct *const child)
{ … }
static int task_ptrace(const struct task_struct *const parent,
const struct task_struct *const child)
{ … }
static int hook_ptrace_access_check(struct task_struct *const child,
const unsigned int mode)
{ … }
static int hook_ptrace_traceme(struct task_struct *const parent)
{ … }
static bool domain_is_scoped(const struct landlock_ruleset *const client,
const struct landlock_ruleset *const server,
access_mask_t scope)
{ … }
static bool sock_is_scoped(struct sock *const other,
const struct landlock_ruleset *const domain)
{ … }
static bool is_abstract_socket(struct sock *const sock)
{ … }
static int hook_unix_stream_connect(struct sock *const sock,
struct sock *const other,
struct sock *const newsk)
{ … }
static int hook_unix_may_send(struct socket *const sock,
struct socket *const other)
{ … }
static int hook_task_kill(struct task_struct *const p,
struct kernel_siginfo *const info, const int sig,
const struct cred *const cred)
{ … }
static int hook_file_send_sigiotask(struct task_struct *tsk,
struct fown_struct *fown, int signum)
{ … }
static struct security_hook_list landlock_hooks[] __ro_after_init = …;
__init void landlock_add_task_hooks(void)
{ … }