|
16 | 16 |
|
17 | 17 | #include <linux/fs.h> |
18 | 18 |
|
19 | | -/* |
20 | | - * We use MAY_EXEC, MAY_WRITE, MAY_READ, MAY_APPEND and the following flags |
21 | | - * for profile permissions |
22 | | - */ |
23 | | -#define AA_MAY_CREATE 0x0010 |
24 | | -#define AA_MAY_DELETE 0x0020 |
25 | | -#define AA_MAY_META_WRITE 0x0040 |
26 | | -#define AA_MAY_META_READ 0x0080 |
27 | | - |
28 | | -#define AA_MAY_CHMOD 0x0100 |
29 | | -#define AA_MAY_CHOWN 0x0200 |
30 | | -#define AA_MAY_LOCK 0x0400 |
31 | | -#define AA_EXEC_MMAP 0x0800 |
32 | | - |
33 | | -#define AA_MAY_LINK 0x1000 |
34 | | -#define AA_LINK_SUBSET AA_MAY_LOCK /* overlaid */ |
35 | | -#define AA_MAY_ONEXEC 0x40000000 /* exec allows onexec */ |
36 | | -#define AA_MAY_CHANGE_PROFILE 0x80000000 |
37 | | -#define AA_MAY_CHANGEHAT 0x80000000 /* ctrl auditing only */ |
| 19 | +#define AA_MAY_EXEC MAY_EXEC |
| 20 | +#define AA_MAY_WRITE MAY_WRITE |
| 21 | +#define AA_MAY_READ MAY_READ |
| 22 | +#define AA_MAY_APPEND MAY_APPEND |
| 23 | + |
| 24 | +#define AA_MAY_CREATE 0x0010 |
| 25 | +#define AA_MAY_DELETE 0x0020 |
| 26 | +#define AA_MAY_OPEN 0x0040 |
| 27 | +#define AA_MAY_RENAME 0x0080 /* pair */ |
| 28 | + |
| 29 | +#define AA_MAY_SETATTR 0x0100 /* meta write */ |
| 30 | +#define AA_MAY_GETATTR 0x0200 /* meta read */ |
| 31 | +#define AA_MAY_SETCRED 0x0400 /* security cred/attr */ |
| 32 | +#define AA_MAY_GETCRED 0x0800 |
| 33 | + |
| 34 | +#define AA_MAY_CHMOD 0x1000 /* pair */ |
| 35 | +#define AA_MAY_CHOWN 0x2000 /* pair */ |
| 36 | +#define AA_MAY_CHGRP 0x4000 /* pair */ |
| 37 | +#define AA_MAY_LOCK 0x8000 /* LINK_SUBSET overlaid */ |
| 38 | + |
| 39 | +#define AA_EXEC_MMAP 0x00010000 |
| 40 | +#define AA_MAY_MPROT 0x00020000 /* extend conditions */ |
| 41 | +#define AA_MAY_LINK 0x00040000 /* pair */ |
| 42 | +#define AA_MAY_SNAPSHOT 0x00080000 /* pair */ |
| 43 | + |
| 44 | +#define AA_MAY_DELEGATE |
| 45 | +#define AA_CONT_MATCH 0x08000000 |
| 46 | + |
| 47 | +#define AA_MAY_STACK 0x10000000 |
| 48 | +#define AA_MAY_ONEXEC 0x20000000 /* either stack or change_profile */ |
| 49 | +#define AA_MAY_CHANGE_PROFILE 0x40000000 |
| 50 | +#define AA_MAY_CHANGEHAT 0x80000000 |
| 51 | + |
| 52 | +#define AA_LINK_SUBSET AA_MAY_LOCK /* overlaid */ |
| 53 | + |
| 54 | + |
| 55 | +#define PERMS_CHRS_MASK (MAY_READ | MAY_WRITE | AA_MAY_CREATE | \ |
| 56 | + AA_MAY_DELETE | AA_MAY_LINK | AA_MAY_LOCK | \ |
| 57 | + AA_MAY_EXEC | AA_EXEC_MMAP | AA_MAY_APPEND) |
| 58 | + |
| 59 | +#define PERMS_NAMES_MASK (PERMS_CHRS_MASK | AA_MAY_OPEN | AA_MAY_RENAME | \ |
| 60 | + AA_MAY_SETATTR | AA_MAY_GETATTR | AA_MAY_SETCRED | \ |
| 61 | + AA_MAY_GETCRED | AA_MAY_CHMOD | AA_MAY_CHOWN | \ |
| 62 | + AA_MAY_CHGRP | AA_MAY_MPROT | AA_MAY_SNAPSHOT | \ |
| 63 | + AA_MAY_STACK | AA_MAY_ONEXEC | \ |
| 64 | + AA_MAY_CHANGE_PROFILE | AA_MAY_CHANGEHAT) |
| 65 | + |
| 66 | +extern const char aa_file_perm_chrs[]; |
| 67 | +extern const char *aa_file_perm_names[]; |
38 | 68 |
|
| 69 | +void aa_perm_mask_to_str(char *str, const char *chrs, u32 mask); |
39 | 70 |
|
40 | 71 | #endif /* __AA_PERM_H */ |
0 commit comments