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