13 #ifndef _SECURITY_SMACK_H
14 #define _SECURITY_SMACK_H
16 #include <linux/capability.h>
21 #include <linux/list.h>
28 #define SMK_LABELLEN 24
29 #define SMK_LONGLABEL 256
38 #define SMK_CIPSOLEN 24
72 #define SMK_INODE_INSTANT 0x01
73 #define SMK_INODE_TRANSMUTE 0x02
74 #define SMK_INODE_CHANGED 0x04
131 #define SMK_FSDEFAULT "smackfsdef="
132 #define SMK_FSFLOOR "smackfsfloor="
133 #define SMK_FSHAT "smackfshat="
134 #define SMK_FSROOT "smackfsroot="
136 #define SMACK_CIPSO_OPTION "-CIPSO"
148 #define SMACK_UNLABELED_SOCKET 0
149 #define SMACK_CIPSO_SOCKET 1
154 #define SMACK_MAGIC 0x43415d53
159 #define SMACK_CIPSO_DOI_DEFAULT 3
160 #define SMACK_CIPSO_DOI_INVALID -1
161 #define SMACK_CIPSO_DIRECT_DEFAULT 250
162 #define SMACK_CIPSO_MAPPED_DEFAULT 251
163 #define SMACK_CIPSO_MAXCATVAL 63
164 #define SMACK_CIPSO_MAXLEVEL 255
165 #define SMACK_CIPSO_MAXCATNUM 239
170 #define MAY_TRANSMUTE 64
174 #define MAY_ANYREAD (MAY_READ | MAY_EXEC)
175 #define MAY_READWRITE (MAY_READ | MAY_WRITE)
181 #define SMK_NUM_ACCESS_TYPE 5
185 const char *
function;
241 extern struct security_operations
smack_ops;
246 static inline int smk_inode_transmutable(
const struct inode *isp)
255 static inline char *smk_of_inode(
const struct inode *isp)
264 static inline char *smk_of_task(
const struct task_smack *
tsp)
272 static inline char *smk_of_forked(
const struct task_smack *
tsp)
280 static inline char *smk_of_current(
void)
289 static inline int smack_privileged(
int cap)
301 #define SMACK_AUDIT_DENIED 0x1
302 #define SMACK_AUDIT_ACCEPT 0x2
305 void smack_log(
char *subject_label,
char *object_label,
319 memset(&a->sad, 0,
sizeof(a->sad));
321 a->a.smack_audit_data = &a->sad;
322 a->a.smack_audit_data->function =
func;
328 smk_ad_init(a, func, type);
329 memset(net, 0,
sizeof(*net));
333 static inline void smk_ad_setfield_u_tsk(
struct smk_audit_info *a,
338 static inline void smk_ad_setfield_u_fs_path_dentry(
struct smk_audit_info *a,
343 static inline void smk_ad_setfield_u_fs_inode(
struct smk_audit_info *a,
348 static inline void smk_ad_setfield_u_fs_path(
struct smk_audit_info *a,
353 static inline void smk_ad_setfield_u_net_sk(
struct smk_audit_info *a,
361 static inline void smk_ad_init(
struct smk_audit_info *a,
const char *func,
365 static inline void smk_ad_setfield_u_tsk(
struct smk_audit_info *a,
369 static inline void smk_ad_setfield_u_fs_path_dentry(
struct smk_audit_info *a,
373 static inline void smk_ad_setfield_u_fs_path_mnt(
struct smk_audit_info *a,
377 static inline void smk_ad_setfield_u_fs_inode(
struct smk_audit_info *a,
381 static inline void smk_ad_setfield_u_fs_path(
struct smk_audit_info *a,
385 static inline void smk_ad_setfield_u_net_sk(
struct smk_audit_info *a,