diff options
| author | Stephen Smalley <sds@tycho.nsa.gov> | 2009-09-30 13:41:02 -0400 |
|---|---|---|
| committer | James Morris <jmorris@namei.org> | 2009-10-07 06:56:44 -0400 |
| commit | 8753f6bec352392b52ed9b5e290afb34379f4612 (patch) | |
| tree | b5f381be9f56125309bfbfcaa73d68e08c309747 /security | |
| parent | c6d3aaa4e35c71a32a86ececacd4eea7ecfc316c (diff) | |
selinux: generate flask headers during kernel build
Add a simple utility (scripts/selinux/genheaders) and invoke it to
generate the kernel-private class and permission indices in flask.h
and av_permissions.h automatically during the kernel build from the
security class mapping definitions in classmap.h. Adding new kernel
classes and permissions can then be done just by adding them to classmap.h.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
| -rw-r--r-- | security/selinux/Makefile | 10 | ||||
| -rw-r--r-- | security/selinux/include/av_permissions.h | 870 | ||||
| -rw-r--r-- | security/selinux/include/flask.h | 91 | ||||
| -rw-r--r-- | security/selinux/ss/Makefile | 2 |
4 files changed, 10 insertions, 963 deletions
diff --git a/security/selinux/Makefile b/security/selinux/Makefile index d47fc5e545e0..f013982df417 100644 --- a/security/selinux/Makefile +++ b/security/selinux/Makefile | |||
| @@ -18,5 +18,13 @@ selinux-$(CONFIG_SECURITY_NETWORK_XFRM) += xfrm.o | |||
| 18 | 18 | ||
| 19 | selinux-$(CONFIG_NETLABEL) += netlabel.o | 19 | selinux-$(CONFIG_NETLABEL) += netlabel.o |
| 20 | 20 | ||
| 21 | EXTRA_CFLAGS += -Isecurity/selinux/include | 21 | EXTRA_CFLAGS += -Isecurity/selinux -Isecurity/selinux/include |
| 22 | 22 | ||
| 23 | $(obj)/avc.o: $(obj)/flask.h | ||
| 24 | |||
| 25 | quiet_cmd_flask = GEN $(obj)/flask.h $(obj)/av_permissions.h | ||
| 26 | cmd_flask = scripts/selinux/genheaders/genheaders $(obj)/flask.h $(obj)/av_permissions.h | ||
| 27 | |||
| 28 | targets += flask.h | ||
| 29 | $(obj)/flask.h: $(src)/include/classmap.h FORCE | ||
| 30 | $(call if_changed,flask) | ||
diff --git a/security/selinux/include/av_permissions.h b/security/selinux/include/av_permissions.h deleted file mode 100644 index fef2582b734d..000000000000 --- a/security/selinux/include/av_permissions.h +++ /dev/null | |||
| @@ -1,870 +0,0 @@ | |||
| 1 | /* This file is automatically generated. Do not edit. */ | ||
| 2 | #define COMMON_FILE__IOCTL 0x00000001UL | ||
| 3 | #define COMMON_FILE__READ 0x00000002UL | ||
| 4 | #define COMMON_FILE__WRITE 0x00000004UL | ||
| 5 | #define COMMON_FILE__CREATE 0x00000008UL | ||
| 6 | #define COMMON_FILE__GETATTR 0x00000010UL | ||
| 7 | #define COMMON_FILE__SETATTR 0x00000020UL | ||
| 8 | #define COMMON_FILE__LOCK 0x00000040UL | ||
| 9 | #define COMMON_FILE__RELABELFROM 0x00000080UL | ||
| 10 | #define COMMON_FILE__RELABELTO 0x00000100UL | ||
| 11 | #define COMMON_FILE__APPEND 0x00000200UL | ||
| 12 | #define COMMON_FILE__UNLINK 0x00000400UL | ||
| 13 | #define COMMON_FILE__LINK 0x00000800UL | ||
| 14 | #define COMMON_FILE__RENAME 0x00001000UL | ||
| 15 | #define COMMON_FILE__EXECUTE 0x00002000UL | ||
| 16 | #define COMMON_FILE__SWAPON 0x00004000UL | ||
| 17 | #define COMMON_FILE__QUOTAON 0x00008000UL | ||
| 18 | #define COMMON_FILE__MOUNTON 0x00010000UL | ||
| 19 | #define COMMON_SOCKET__IOCTL 0x00000001UL | ||
| 20 | #define COMMON_SOCKET__READ 0x00000002UL | ||
| 21 | #define COMMON_SOCKET__WRITE 0x00000004UL | ||
| 22 | #define COMMON_SOCKET__CREATE 0x00000008UL | ||
| 23 | #define COMMON_SOCKET__GETATTR 0x00000010UL | ||
| 24 | #define COMMON_SOCKET__SETATTR 0x00000020UL | ||
| 25 | #define COMMON_SOCKET__LOCK 0x00000040UL | ||
| 26 | #define COMMON_SOCKET__RELABELFROM 0x00000080UL | ||
| 27 | #define COMMON_SOCKET__RELABELTO 0x00000100UL | ||
| 28 | #define COMMON_SOCKET__APPEND 0x00000200UL | ||
| 29 | #define COMMON_SOCKET__BIND 0x00000400UL | ||
| 30 | #define COMMON_SOCKET__CONNECT 0x00000800UL | ||
| 31 | #define COMMON_SOCKET__LISTEN 0x00001000UL | ||
| 32 | #define COMMON_SOCKET__ACCEPT 0x00002000UL | ||
| 33 | #define COMMON_SOCKET__GETOPT 0x00004000UL | ||
| 34 | #define COMMON_SOCKET__SETOPT 0x00008000UL | ||
| 35 | #define COMMON_SOCKET__SHUTDOWN 0x00010000UL | ||
| 36 | #define COMMON_SOCKET__RECVFROM 0x00020000UL | ||
| 37 | #define COMMON_SOCKET__SENDTO 0x00040000UL | ||
| 38 | #define COMMON_SOCKET__RECV_MSG 0x00080000UL | ||
| 39 | #define COMMON_SOCKET__SEND_MSG 0x00100000UL | ||
| 40 | #define COMMON_SOCKET__NAME_BIND 0x00200000UL | ||
| 41 | #define COMMON_IPC__CREATE 0x00000001UL | ||
| 42 | #define COMMON_IPC__DESTROY 0x00000002UL | ||
| 43 | #define COMMON_IPC__GETATTR 0x00000004UL | ||
| 44 | #define COMMON_IPC__SETATTR 0x00000008UL | ||
| 45 | #define COMMON_IPC__READ 0x00000010UL | ||
| 46 | #define COMMON_IPC__WRITE 0x00000020UL | ||
| 47 | #define COMMON_IPC__ASSOCIATE 0x00000040UL | ||
| 48 | #define COMMON_IPC__UNIX_READ 0x00000080UL | ||
| 49 | #define COMMON_IPC__UNIX_WRITE 0x00000100UL | ||
| 50 | #define FILESYSTEM__MOUNT 0x00000001UL | ||
| 51 | #define FILESYSTEM__REMOUNT 0x00000002UL | ||
| 52 | #define FILESYSTEM__UNMOUNT 0x00000004UL | ||
| 53 | #define FILESYSTEM__GETATTR 0x00000008UL | ||
| 54 | #define FILESYSTEM__RELABELFROM 0x00000010UL | ||
| 55 | #define FILESYSTEM__RELABELTO 0x00000020UL | ||
| 56 | #define FILESYSTEM__TRANSITION 0x00000040UL | ||
| 57 | #define FILESYSTEM__ASSOCIATE 0x00000080UL | ||
| 58 | #define FILESYSTEM__QUOTAMOD 0x00000100UL | ||
| 59 | #define FILESYSTEM__QUOTAGET 0x00000200UL | ||
| 60 | #define DIR__IOCTL 0x00000001UL | ||
| 61 | #define DIR__READ 0x00000002UL | ||
| 62 | #define DIR__WRITE 0x00000004UL | ||
| 63 | #define DIR__CREATE 0x00000008UL | ||
| 64 | #define DIR__GETATTR 0x00000010UL | ||
| 65 | #define DIR__SETATTR 0x00000020UL | ||
| 66 | #define DIR__LOCK 0x00000040UL | ||
| 67 | #define DIR__RELABELFROM 0x00000080UL | ||
| 68 | #define DIR__RELABELTO 0x00000100UL | ||
| 69 | #define DIR__APPEND 0x00000200UL | ||
| 70 | #define DIR__UNLINK 0x00000400UL | ||
| 71 | #define DIR__LINK 0x00000800UL | ||
| 72 | #define DIR__RENAME 0x00001000UL | ||
| 73 | #define DIR__EXECUTE 0x00002000UL | ||
| 74 | #define DIR__SWAPON 0x00004000UL | ||
| 75 | #define DIR__QUOTAON 0x00008000UL | ||
| 76 | #define DIR__MOUNTON 0x00010000UL | ||
| 77 | #define DIR__ADD_NAME 0x00020000UL | ||
| 78 | #define DIR__REMOVE_NAME 0x00040000UL | ||
| 79 | #define DIR__REPARENT 0x00080000UL | ||
| 80 | #define DIR__SEARCH 0x00100000UL | ||
| 81 | #define DIR__RMDIR 0x00200000UL | ||
| 82 | #define DIR__OPEN 0x00400000UL | ||
| 83 | #define FILE__IOCTL 0x00000001UL | ||
| 84 | #define FILE__READ 0x00000002UL | ||
| 85 | #define FILE__WRITE 0x00000004UL | ||
| 86 | #define FILE__CREATE 0x00000008UL | ||
| 87 | #define FILE__GETATTR 0x00000010UL | ||
| 88 | #define FILE__SETATTR 0x00000020UL | ||
| 89 | #define FILE__LOCK 0x00000040UL | ||
| 90 | #define FILE__RELABELFROM 0x00000080UL | ||
| 91 | #define FILE__RELABELTO 0x00000100UL | ||
| 92 | #define FILE__APPEND 0x00000200UL | ||
| 93 | #define FILE__UNLINK 0x00000400UL | ||
| 94 | #define FILE__LINK 0x00000800UL | ||
| 95 | #define FILE__RENAME 0x00001000UL | ||
| 96 | #define FILE__EXECUTE 0x00002000UL | ||
| 97 | #define FILE__SWAPON 0x00004000UL | ||
| 98 | #define FILE__QUOTAON 0x00008000UL | ||
| 99 | #define FILE__MOUNTON 0x00010000UL | ||
| 100 | #define FILE__EXECUTE_NO_TRANS 0x00020000UL | ||
| 101 | #define FILE__ENTRYPOINT 0x00040000UL | ||
| 102 | #define FILE__EXECMOD 0x00080000UL | ||
| 103 | #define FILE__OPEN 0x00100000UL | ||
| 104 | #define LNK_FILE__IOCTL 0x00000001UL | ||
| 105 | #define LNK_FILE__READ 0x00000002UL | ||
| 106 | #define LNK_FILE__WRITE 0x00000004UL | ||
| 107 | #define LNK_FILE__CREATE 0x00000008UL | ||
| 108 | #define LNK_FILE__GETATTR 0x00000010UL | ||
| 109 | #define LNK_FILE__SETATTR 0x00000020UL | ||
| 110 | #define LNK_FILE__LOCK 0x00000040UL | ||
| 111 | #define LNK_FILE__RELABELFROM 0x00000080UL | ||
| 112 | #define LNK_FILE__RELABELTO 0x00000100UL | ||
| 113 | #define LNK_FILE__APPEND 0x00000200UL | ||
| 114 | #define LNK_FILE__UNLINK 0x00000400UL | ||
| 115 | #define LNK_FILE__LINK 0x00000800UL | ||
| 116 | #define LNK_FILE__RENAME 0x00001000UL | ||
| 117 | #define LNK_FILE__EXECUTE 0x00002000UL | ||
| 118 | #define LNK_FILE__SWAPON 0x00004000UL | ||
| 119 | #define LNK_FILE__QUOTAON 0x00008000UL | ||
| 120 | #define LNK_FILE__MOUNTON 0x00010000UL | ||
| 121 | #define CHR_FILE__IOCTL 0x00000001UL | ||
| 122 | #define CHR_FILE__READ 0x00000002UL | ||
| 123 | #define CHR_FILE__WRITE 0x00000004UL | ||
| 124 | #define CHR_FILE__CREATE 0x00000008UL | ||
| 125 | #define CHR_FILE__GETATTR 0x00000010UL | ||
| 126 | #define CHR_FILE__SETATTR 0x00000020UL | ||
| 127 | #define CHR_FILE__LOCK 0x00000040UL | ||
| 128 | #define CHR_FILE__RELABELFROM 0x00000080UL | ||
| 129 | #define CHR_FILE__RELABELTO 0x00000100UL | ||
| 130 | #define CHR_FILE__APPEND 0x00000200UL | ||
| 131 | #define CHR_FILE__UNLINK 0x00000400UL | ||
| 132 | #define CHR_FILE__LINK 0x00000800UL | ||
| 133 | #define CHR_FILE__RENAME 0x00001000UL | ||
| 134 | #define CHR_FILE__EXECUTE 0x00002000UL | ||
| 135 | #define CHR_FILE__SWAPON 0x00004000UL | ||
| 136 | #define CHR_FILE__QUOTAON 0x00008000UL | ||
| 137 | #define CHR_FILE__MOUNTON 0x00010000UL | ||
| 138 | #define CHR_FILE__EXECUTE_NO_TRANS 0x00020000UL | ||
| 139 | #define CHR_FILE__ENTRYPOINT 0x00040000UL | ||
| 140 | #define CHR_FILE__EXECMOD 0x00080000UL | ||
| 141 | #define CHR_FILE__OPEN 0x00100000UL | ||
| 142 | #define BLK_FILE__IOCTL 0x00000001UL | ||
| 143 | #define BLK_FILE__READ 0x00000002UL | ||
| 144 | #define BLK_FILE__WRITE 0x00000004UL | ||
| 145 | #define BLK_FILE__CREATE 0x00000008UL | ||
| 146 | #define BLK_FILE__GETATTR 0x00000010UL | ||
| 147 | #define BLK_FILE__SETATTR 0x00000020UL | ||
| 148 | #define BLK_FILE__LOCK 0x00000040UL | ||
| 149 | #define BLK_FILE__RELABELFROM 0x00000080UL | ||
| 150 | #define BLK_FILE__RELABELTO 0x00000100UL | ||
| 151 | #define BLK_FILE__APPEND 0x00000200UL | ||
| 152 | #define BLK_FILE__UNLINK 0x00000400UL | ||
| 153 | #define BLK_FILE__LINK 0x00000800UL | ||
| 154 | #define BLK_FILE__RENAME 0x00001000UL | ||
| 155 | #define BLK_FILE__EXECUTE 0x00002000UL | ||
| 156 | #define BLK_FILE__SWAPON 0x00004000UL | ||
| 157 | #define BLK_FILE__QUOTAON 0x00008000UL | ||
| 158 | #define BLK_FILE__MOUNTON 0x00010000UL | ||
| 159 | #define BLK_FILE__OPEN 0x00020000UL | ||
| 160 | #define SOCK_FILE__IOCTL 0x00000001UL | ||
| 161 | #define SOCK_FILE__READ 0x00000002UL | ||
