^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * AppArmor security module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * This file contains AppArmor ipc mediation function definitions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright (C) 1998-2008 Novell/SUSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright 2009-2017 Canonical Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #ifndef __AA_IPC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define __AA_IPC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct aa_profile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define AA_PTRACE_TRACE MAY_WRITE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define AA_PTRACE_READ MAY_READ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define AA_MAY_BE_TRACED AA_MAY_APPEND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define AA_MAY_BE_READ AA_MAY_CREATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define PTRACE_PERM_SHIFT 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define AA_PTRACE_PERM_MASK (AA_PTRACE_READ | AA_PTRACE_TRACE | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) AA_MAY_BE_READ | AA_MAY_BE_TRACED)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define AA_SIGNAL_PERM_MASK (MAY_READ | MAY_WRITE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define AA_SFS_SIG_MASK "hup int quit ill trap abrt bus fpe kill usr1 " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) "segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) "xcpu xfsz vtalrm prof winch io pwr sys emt lost"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) int aa_may_ptrace(struct aa_label *tracer, struct aa_label *tracee,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) u32 request);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) int aa_may_signal(struct aa_label *sender, struct aa_label *target, int sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #endif /* __AA_IPC_H */