1 |
kumaneko |
111 |
/* |
2 |
|
|
* include/linux/ccs_common.h |
3 |
|
|
* |
4 |
|
|
* Common functions for SAKURA and TOMOYO. |
5 |
|
|
* |
6 |
|
|
* Copyright (C) 2005-2007 NTT DATA CORPORATION |
7 |
|
|
* |
8 |
kumaneko |
290 |
* Version: 1.4.2 2007/07/13 |
9 |
kumaneko |
111 |
* |
10 |
|
|
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
11 |
|
|
* See README.ccs for ChangeLog. |
12 |
|
|
* |
13 |
|
|
*/ |
14 |
|
|
|
15 |
|
|
#ifndef _LINUX_CCS_COMMON_H |
16 |
|
|
#define _LINUX_CCS_COMMON_H |
17 |
|
|
|
18 |
|
|
#include <linux/string.h> |
19 |
|
|
#include <linux/mm.h> |
20 |
|
|
#include <linux/utime.h> |
21 |
|
|
#include <linux/file.h> |
22 |
|
|
#include <linux/smp_lock.h> |
23 |
|
|
#include <linux/module.h> |
24 |
|
|
#include <linux/init.h> |
25 |
|
|
#include <linux/slab.h> |
26 |
|
|
#include <linux/poll.h> |
27 |
|
|
#include <asm/uaccess.h> |
28 |
|
|
#include <stdarg.h> |
29 |
|
|
#include <linux/delay.h> |
30 |
|
|
#include <linux/version.h> |
31 |
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) |
32 |
|
|
#include <linux/kmod.h> |
33 |
|
|
#endif |
34 |
|
|
|
35 |
|
|
#ifndef __user |
36 |
|
|
#define __user |
37 |
|
|
#endif |
38 |
|
|
|
39 |
|
|
struct mini_stat { |
40 |
|
|
uid_t uid; |
41 |
|
|
gid_t gid; |
42 |
|
|
ino_t ino; |
43 |
|
|
}; |
44 |
|
|
struct dentry; |
45 |
|
|
struct vfsmount; |
46 |
|
|
struct obj_info { |
47 |
|
|
u8 validate_done; |
48 |
|
|
u8 path1_valid; |
49 |
|
|
u8 path1_parent_valid; |
50 |
|
|
u8 path2_parent_valid; |
51 |
|
|
struct dentry *path1_dentry; |
52 |
|
|
struct vfsmount *path1_vfsmnt; |
53 |
|
|
struct dentry *path2_dentry; |
54 |
|
|
struct vfsmount *path2_vfsmnt; |
55 |
|
|
struct mini_stat path1_stat; |
56 |
|
|
/* I don't handle path2_stat for rename operation. */ |
57 |
|
|
struct mini_stat path1_parent_stat; |
58 |
|
|
struct mini_stat path2_parent_stat; |
59 |
|
|
}; |
60 |
|
|
|
61 |
|
|
struct path_info { |
62 |
|
|
const char *name; |
63 |
|
|
u32 hash; /* = full_name_hash(name, strlen(name)) */ |
64 |
|
|
u16 total_len; /* = strlen(name) */ |
65 |
|
|
u16 const_len; /* = const_part_length(name) */ |
66 |
|
|
u8 is_dir; /* = strendswith(name, "/") */ |
67 |
|
|
u8 is_patterned; /* = PathContainsPattern(name) */ |
68 |
|
|
u16 depth; /* = PathDepth(name) */ |
69 |
|
|
}; |
70 |
|
|
|
71 |
|
|
#define CCS_MAX_PATHNAME_LEN 4000 |
72 |
|
|
|
73 |
kumaneko |
214 |
struct group_member { |
74 |
kumaneko |
111 |
struct group_member *next; |
75 |
|
|
const struct path_info *member_name; |
76 |
|
|
int is_deleted; |
77 |
kumaneko |
214 |
}; |
78 |
kumaneko |
111 |
|
79 |
kumaneko |
214 |
struct group_entry { |
80 |
kumaneko |
111 |
struct group_entry *next; |
81 |
|
|
const struct path_info *group_name; |
82 |
kumaneko |
214 |
struct group_member *first_member; |
83 |
|
|
}; |
84 |
kumaneko |
111 |
|
85 |
kumaneko |
214 |
struct address_group_member { |
86 |
kumaneko |
111 |
struct address_group_member *next; |
87 |
|
|
union { |
88 |
|
|
u32 ipv4; /* Host byte order */ |
89 |
|
|
u16 ipv6[8]; /* Network byte order */ |
90 |
|
|
} min, max; |
91 |
|
|
u8 is_deleted; |
92 |
|
|
u8 is_ipv6; |
93 |
kumaneko |
214 |
}; |
94 |
kumaneko |
111 |
|
95 |
kumaneko |
214 |
struct address_group_entry { |
96 |
kumaneko |
111 |
struct address_group_entry *next; |
97 |
|
|
const struct path_info *group_name; |
98 |
kumaneko |
214 |
struct address_group_member *first_member; |
99 |
|
|
}; |
100 |
kumaneko |
111 |
|
101 |
|
|
/* |
102 |
|
|
* TOMOYO uses the following structures. |
103 |
|
|
* Memory allocated for these structures are never kfree()ed. |
104 |
|
|
* Since no locks are used for reading, assignment must be performed atomically. |
105 |
|
|
*/ |
106 |
|
|
|
107 |
|
|
/************************* The structure for domains. *************************/ |
108 |
|
|
|
109 |
|
|
struct condition_list; |
110 |
|
|
|
111 |
|
|
struct acl_info { |
112 |
|
|
struct acl_info *next; |
113 |
|
|
const struct condition_list *cond; |
114 |
|
|
u8 type; |
115 |
|
|
u8 is_deleted; |
116 |
|
|
union { |
117 |
|
|
u16 w; |
118 |
|
|
u8 b[2]; |
119 |
|
|
} u; |
120 |
|
|
}; |
121 |
|
|
|
122 |
|
|
struct domain_info { |
123 |
|
|
struct domain_info *next; /* Pointer to next record. NULL if none. */ |
124 |
|
|
struct acl_info *first_acl_ptr; /* Pointer to first acl. NULL if none. */ |
125 |
|
|
const struct path_info *domainname; /* Name of this domain. Never NULL. */ |
126 |
|
|
u8 profile; /* Profile to use. */ |
127 |
|
|
u8 is_deleted; /* Delete flag. */ |
128 |
|
|
u8 quota_warned; /* Quota warnning done flag. */ |
129 |
|
|
}; |
130 |
|
|
|
131 |
|
|
#define MAX_PROFILES 256 |
132 |
|
|
|
133 |
kumaneko |
214 |
struct file_acl_record { |
134 |
kumaneko |
111 |
struct acl_info head; /* type = TYPE_FILE_ACL, b[0] = perm, b[1] = u_is_group */ |
135 |
|
|
union { |
136 |
|
|
const struct path_info *filename; /* Pointer to single pathname. */ |
137 |
|
|
const struct group_entry *group; /* Pointer to pathname group. */ |
138 |
|
|
} u; |
139 |
kumaneko |
214 |
}; |
140 |
kumaneko |
111 |
|
141 |
kumaneko |
214 |
struct argv0_acl_record { |
142 |
kumaneko |
111 |
struct acl_info head; /* type = TYPE_ARGV0_ACL */ |
143 |
|
|
const struct path_info *filename; /* Pointer to single pathname. */ |
144 |
|
|
const struct path_info *argv0; /* strrchr(argv[0], '/') + 1 */ |
145 |
kumaneko |
214 |
}; |
146 |
kumaneko |
111 |
|
147 |
kumaneko |
214 |
struct capability_acl_record { |
148 |
kumaneko |
111 |
struct acl_info head; /* type = TYPE_CAPABILITY_ACL, w = capability index. */ |
149 |
kumaneko |
214 |
}; |
150 |
kumaneko |
111 |
|
151 |
kumaneko |
214 |
struct signal_acl_record { |
152 |
kumaneko |
111 |
struct acl_info head; /* type = TYPE_SIGNAL_ACL, w = signal_number. */ |
153 |
|
|
const struct path_info *domainname; /* Pointer to destination pattern. */ |
154 |
kumaneko |
214 |
}; |
155 |
kumaneko |
111 |
|
156 |
kumaneko |
214 |
struct single_acl_record { |
157 |
kumaneko |
111 |
struct acl_info head; /* type = TYPE_*, w = u_is_group */ |
158 |
|
|
union { |
159 |
|
|
const struct path_info *filename; /* Pointer to single pathname. */ |
160 |
|
|
const struct group_entry *group; /* Pointer to pathname group. */ |
161 |
|
|
} u; |
162 |
kumaneko |
214 |
}; |
163 |
kumaneko |
111 |
|
164 |
kumaneko |
214 |
struct double_acl_record { |
165 |
kumaneko |
111 |
struct acl_info head; /* type = TYPE_RENAME_ACL or TYPE_LINK_ACL, b[0] = u1_is_group, b[1] = u2_is_group */ |
166 |
|
|
union { |
167 |
|
|
const struct path_info *filename1; /* Pointer to single pathname. */ |
168 |
|
|
const struct group_entry *group1; /* Pointer to pathname group. */ |
169 |
|
|
} u1; |
170 |
|
|
union { |
171 |
|
|
const struct path_info *filename2; /* Pointer to single pathname. */ |
172 |
|
|
const struct group_entry *group2; /* Pointer to pathname group. */ |
173 |
|
|
} u2; |
174 |
kumaneko |
214 |
}; |
175 |
kumaneko |
111 |
|
176 |
|
|
#define IP_RECORD_TYPE_ADDRESS_GROUP 0 |
177 |
|
|
#define IP_RECORD_TYPE_IPv4 1 |
178 |
|
|
#define IP_RECORD_TYPE_IPv6 2 |
179 |
|
|
|
180 |
kumaneko |
214 |
struct ip_network_acl_record { |
181 |
kumaneko |
111 |
struct acl_info head; /* type = TYPE_IP_NETWORK_ACL, b[0] = socket_type, b[1] = IP_RECORD_TYPE_* */ |
182 |
|
|
union { |
183 |
|
|
struct { |
184 |
|
|
u32 min; /* Start of IPv4 address range. Host endian. */ |
185 |
|
|
u32 max; /* End of IPv4 address range. Host endian. */ |
186 |
|
|
} ipv4; |
187 |
|
|
struct { |
188 |
|
|
u16 min[8]; /* Start of IPv6 address range. Big endian. */ |
189 |
|
|
u16 max[8]; /* End of IPv6 address range. Big endian. */ |
190 |
|
|
} ipv6; |
191 |
|
|
const struct address_group_entry *group; /* Pointer to address group. */ |
192 |
|
|
} u; |
193 |
|
|
u16 min_port; /* Start of port number range. */ |
194 |
|
|
u16 max_port; /* End of port number range. */ |
195 |
kumaneko |
214 |
}; |
196 |
kumaneko |
111 |
|
197 |
|
|
/************************* Keywords for ACLs. *************************/ |
198 |
|
|
|
199 |
|
|
#define KEYWORD_ADDRESS_GROUP "address_group " |
200 |
|
|
#define KEYWORD_ADDRESS_GROUP_LEN (sizeof(KEYWORD_ADDRESS_GROUP) - 1) |
201 |
|
|
#define KEYWORD_AGGREGATOR "aggregator " |
202 |
|
|
#define KEYWORD_AGGREGATOR_LEN (sizeof(KEYWORD_AGGREGATOR) - 1) |
203 |
|
|
#define KEYWORD_ALIAS "alias " |
204 |
|
|
#define KEYWORD_ALIAS_LEN (sizeof(KEYWORD_ALIAS) - 1) |
205 |
|
|
#define KEYWORD_ALLOW_ARGV0 "allow_argv0 " |
206 |
|
|
#define KEYWORD_ALLOW_ARGV0_LEN (sizeof(KEYWORD_ALLOW_ARGV0) - 1) |
207 |
|
|
#define KEYWORD_ALLOW_CAPABILITY "allow_capability " |
208 |
|
|
#define KEYWORD_ALLOW_CAPABILITY_LEN (sizeof(KEYWORD_ALLOW_CAPABILITY) - 1) |
209 |
|
|
#define KEYWORD_ALLOW_CHROOT "allow_chroot " |
210 |
|
|
#define KEYWORD_ALLOW_CHROOT_LEN (sizeof(KEYWORD_ALLOW_CHROOT) - 1) |
211 |
|
|
#define KEYWORD_ALLOW_MOUNT "allow_mount " |
212 |
|
|
#define KEYWORD_ALLOW_MOUNT_LEN (sizeof(KEYWORD_ALLOW_MOUNT) - 1) |
213 |
|
|
#define KEYWORD_ALLOW_NETWORK "allow_network " |
214 |
|
|
#define KEYWORD_ALLOW_NETWORK_LEN (sizeof(KEYWORD_ALLOW_NETWORK) - 1) |
215 |
kumaneko |
141 |
#define KEYWORD_ALLOW_PIVOT_ROOT "allow_pivot_root " |
216 |
|
|
#define KEYWORD_ALLOW_PIVOT_ROOT_LEN (sizeof(KEYWORD_ALLOW_PIVOT_ROOT) - 1) |
217 |
kumaneko |
111 |
#define KEYWORD_ALLOW_READ "allow_read " |
218 |
|
|
#define KEYWORD_ALLOW_READ_LEN (sizeof(KEYWORD_ALLOW_READ) - 1) |
219 |
|
|
#define KEYWORD_ALLOW_SIGNAL "allow_signal " |
220 |
|
|
#define KEYWORD_ALLOW_SIGNAL_LEN (sizeof(KEYWORD_ALLOW_SIGNAL) - 1) |
221 |
|
|
#define KEYWORD_DELETE "delete " |
222 |
|
|
#define KEYWORD_DELETE_LEN (sizeof(KEYWORD_DELETE) - 1) |
223 |
|
|
#define KEYWORD_DENY_AUTOBIND "deny_autobind " |
224 |
|
|
#define KEYWORD_DENY_AUTOBIND_LEN (sizeof(KEYWORD_DENY_AUTOBIND) - 1) |
225 |
|
|
#define KEYWORD_DENY_REWRITE "deny_rewrite " |
226 |
|
|
#define KEYWORD_DENY_REWRITE_LEN (sizeof(KEYWORD_DENY_REWRITE) - 1) |
227 |
|
|
#define KEYWORD_DENY_UNMOUNT "deny_unmount " |
228 |
|
|
#define KEYWORD_DENY_UNMOUNT_LEN (sizeof(KEYWORD_DENY_UNMOUNT) - 1) |
229 |
|
|
#define KEYWORD_FILE_PATTERN "file_pattern " |
230 |
|
|
#define KEYWORD_FILE_PATTERN_LEN (sizeof(KEYWORD_FILE_PATTERN) - 1) |
231 |
|
|
#define KEYWORD_INITIALIZER "initializer " |
232 |
|
|
#define KEYWORD_INITIALIZER_LEN (sizeof(KEYWORD_INITIALIZER) - 1) |
233 |
|
|
#define KEYWORD_INITIALIZE_DOMAIN "initialize_domain " |
234 |
|
|
#define KEYWORD_INITIALIZE_DOMAIN_LEN (sizeof(KEYWORD_INITIALIZE_DOMAIN) - 1) |
235 |
|
|
#define KEYWORD_KEEP_DOMAIN "keep_domain " |
236 |
|
|
#define KEYWORD_KEEP_DOMAIN_LEN (sizeof(KEYWORD_KEEP_DOMAIN) - 1) |
237 |
|
|
#define KEYWORD_NO_INITIALIZER "no_initializer " |
238 |
|
|
#define KEYWORD_NO_INITIALIZER_LEN (sizeof(KEYWORD_NO_INITIALIZER) - 1) |
239 |
|
|
#define KEYWORD_NO_INITIALIZE_DOMAIN "no_initialize_domain " |
240 |
|
|
#define KEYWORD_NO_INITIALIZE_DOMAIN_LEN (sizeof(KEYWORD_NO_INITIALIZE_DOMAIN) - 1) |
241 |
|
|
#define KEYWORD_NO_KEEP_DOMAIN "no_keep_domain " |
242 |
|
|
#define KEYWORD_NO_KEEP_DOMAIN_LEN (sizeof(KEYWORD_NO_KEEP_DOMAIN) - 1) |
243 |
|
|
#define KEYWORD_PATH_GROUP "path_group " |
244 |
|
|
#define KEYWORD_PATH_GROUP_LEN (sizeof(KEYWORD_PATH_GROUP) - 1) |
245 |
|
|
#define KEYWORD_SELECT "select " |
246 |
|
|
#define KEYWORD_SELECT_LEN (sizeof(KEYWORD_SELECT) - 1) |
247 |
|
|
#define KEYWORD_UNDELETE "undelete " |
248 |
|
|
#define KEYWORD_UNDELETE_LEN (sizeof(KEYWORD_UNDELETE) - 1) |
249 |
|
|
|
250 |
|
|
#define KEYWORD_USE_PROFILE "use_profile " |
251 |
|
|
|
252 |
|
|
#define KEYWORD_MAC_FOR_CAPABILITY "MAC_FOR_CAPABILITY::" |
253 |
|
|
#define KEYWORD_MAC_FOR_CAPABILITY_LEN (sizeof(KEYWORD_MAC_FOR_CAPABILITY) - 1) |
254 |
|
|
|
255 |
|
|
#define ROOT_NAME "<kernel>" /* A domain definition starts with <kernel> . */ |
256 |
|
|
#define ROOT_NAME_LEN (sizeof(ROOT_NAME) - 1) |
257 |
|
|
|
258 |
|
|
/************************* Index numbers for Access Controls. *************************/ |
259 |
|
|
|
260 |
|
|
#define CCS_PROFILE_COMMENT 0 /* status.txt */ |
261 |
|
|
#define CCS_TOMOYO_MAC_FOR_FILE 1 /* domain_policy.txt */ |
262 |
|
|
#define CCS_TOMOYO_MAC_FOR_ARGV0 2 /* domain_policy.txt */ |
263 |
|
|
#define CCS_TOMOYO_MAC_FOR_NETWORK 3 /* domain_policy.txt */ |
264 |
kumaneko |
115 |
#define CCS_TOMOYO_MAC_FOR_SIGNAL 4 /* domain_policy.txt */ |
265 |
|
|
#define CCS_SAKURA_DENY_CONCEAL_MOUNT 5 |
266 |
|
|
#define CCS_SAKURA_RESTRICT_CHROOT 6 /* system_policy.txt */ |
267 |
|
|
#define CCS_SAKURA_RESTRICT_MOUNT 7 /* system_policy.txt */ |
268 |
|
|
#define CCS_SAKURA_RESTRICT_UNMOUNT 8 /* system_policy.txt */ |
269 |
kumaneko |
141 |
#define CCS_SAKURA_RESTRICT_PIVOT_ROOT 9 /* system_policy.txt */ |
270 |
kumaneko |
115 |
#define CCS_SAKURA_RESTRICT_AUTOBIND 10 /* system_policy.txt */ |
271 |
kumaneko |
120 |
#define CCS_TOMOYO_MAX_ACCEPT_ENTRY 11 |
272 |
kumaneko |
115 |
#define CCS_TOMOYO_MAX_GRANT_LOG 12 |
273 |
|
|
#define CCS_TOMOYO_MAX_REJECT_LOG 13 |
274 |
|
|
#define CCS_TOMOYO_VERBOSE 14 |
275 |
|
|
#define CCS_ALLOW_ENFORCE_GRACE 15 |
276 |
|
|
#define CCS_MAX_CONTROL_INDEX 16 |
277 |
kumaneko |
111 |
|
278 |
|
|
/************************* Index numbers for updates counter. *************************/ |
279 |
|
|
|
280 |
|
|
#define CCS_UPDATES_COUNTER_SYSTEM_POLICY 0 |
281 |
|
|
#define CCS_UPDATES_COUNTER_DOMAIN_POLICY 1 |
282 |
|
|
#define CCS_UPDATES_COUNTER_EXCEPTION_POLICY 2 |
283 |
|
|
#define CCS_UPDATES_COUNTER_STATUS 3 |
284 |
|
|
#define CCS_UPDATES_COUNTER_QUERY 4 |
285 |
|
|
#define CCS_UPDATES_COUNTER_MANAGER 5 |
286 |
|
|
#define CCS_UPDATES_COUNTER_GRANT_LOG 6 |
287 |
|
|
#define CCS_UPDATES_COUNTER_REJECT_LOG 7 |
288 |
|
|
#define MAX_CCS_UPDATES_COUNTER 8 |
289 |
|
|
|
290 |
|
|
/************************* The structure for /proc interfaces. *************************/ |
291 |
|
|
|
292 |
kumaneko |
214 |
struct io_buffer { |
293 |
kumaneko |
111 |
int (*read) (struct io_buffer *); |
294 |
|
|
struct semaphore read_sem; |
295 |
|
|
int (*write) (struct io_buffer *); |
296 |
|
|
struct semaphore write_sem; |
297 |
|
|
int (*poll) (struct file *file, poll_table *wait); |
298 |
kumaneko |
214 |
void *read_var1; /* The position currently reading from. */ |
299 |
kumaneko |
111 |
void *read_var2; /* Extra variables for reading. */ |
300 |
|
|
struct domain_info *write_var1; /* The position currently writing to. */ |
301 |
|
|
int read_step; /* The step for reading. */ |
302 |
|
|
char *read_buf; /* Buffer for reading. */ |
303 |
|
|
int read_eof; /* EOF flag for reading. */ |
304 |
|
|
int read_avail; /* Bytes available for reading. */ |
305 |
|
|
int readbuf_size; /* Size of read buffer. */ |
306 |
|
|
char *write_buf; /* Buffer for writing. */ |
307 |
|
|
int write_avail; /* Bytes available for writing. */ |
308 |
|
|
int writebuf_size; /* Size of write buffer. */ |
309 |
kumaneko |
214 |
}; |
310 |
kumaneko |
111 |
|
311 |
|
|
/************************* PROTOTYPES *************************/ |
312 |
|
|
|
313 |
|
|
char *FindConditionPart(char *data); |
314 |
|
|
char *InitAuditLog(int *len); |
315 |
kumaneko |
214 |
void *ccs_alloc(const size_t size); |
316 |
kumaneko |
111 |
char *print_ipv6(char *buffer, const int buffer_len, const u16 *ip); |
317 |
|
|
const char *GetEXE(void); |
318 |
|
|
const char *GetLastName(const struct domain_info *domain); |
319 |
|
|
const char *GetMSG(const int is_enforce); |
320 |
|
|
const char *acltype2keyword(const unsigned int acl_type); |
321 |
|
|
const char *capability2keyword(const unsigned int capability); |
322 |
|
|
const char *network2keyword(const unsigned int operation); |
323 |
|
|
const struct condition_list *FindOrAssignNewCondition(const char *condition); |
324 |
|
|
int AddAddressGroupPolicy(char *data, const int is_delete); |
325 |
|
|
int AddAggregatorPolicy(char *data, const int is_delete); |
326 |
|
|
int AddAliasPolicy(char *data, const int is_delete); |
327 |
|
|
int AddArgv0Policy(char *data, struct domain_info *domain, const int is_delete); |
328 |
|
|
int AddCapabilityPolicy(char *data, struct domain_info *domain, const int is_delete); |
329 |
|
|
int AddChrootPolicy(char *data, const int is_delete); |
330 |
|
|
int AddDomainACL(struct acl_info *ptr, struct domain_info *domain, struct acl_info *new_ptr); |
331 |
|
|
int AddDomainInitializerPolicy(char *data, const int is_not, const int is_delete, const int is_oldstyle); |
332 |
|
|
int AddDomainKeeperPolicy(char *data, const int is_not, const int is_delete); |
333 |
|
|
int AddFilePolicy(char *data, struct domain_info *domain, const int is_delete); |
334 |
|
|
int AddGloballyReadablePolicy(char *data, const int is_delete); |
335 |
|
|
int AddGroupPolicy(char *data, const int is_delete); |
336 |
|
|
int AddMountPolicy(char *data, const int is_delete); |
337 |
|
|
int AddNetworkPolicy(char *data, struct domain_info *domain, const int is_delete); |
338 |
|
|
int AddNoRewritePolicy(char *pattern, const int is_delete); |
339 |
|
|
int AddNoUmountPolicy(char *data, const int is_delete); |
340 |
|
|
int AddPatternPolicy(char *data, const int is_delete); |
341 |
kumaneko |
141 |
int AddPivotRootPolicy(char *data, const int is_delete); |
342 |
kumaneko |
111 |
int AddReservedPortPolicy(char *data, const int is_delete); |
343 |
|
|
int AddSignalPolicy(char *data, struct domain_info *domain, const int is_delete); |
344 |
|
|
int CCS_CloseControl(struct file *file); |
345 |
|
|
int CCS_OpenControl(const int type, struct file *file); |
346 |
|
|
int CCS_PollControl(struct file *file, poll_table *wait); |
347 |
|
|
int CCS_ReadControl(struct file *file, char __user *buffer, const int buffer_len); |
348 |
|
|
int CCS_WriteControl(struct file *file, const char __user *buffer, const int buffer_len); |
349 |
|
|
int CanSaveAuditLog(const int is_granted); |
350 |
|
|
int CheckCondition(const struct condition_list *condition, struct obj_info *obj_info); |
351 |
|
|
int CheckSupervisor(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); |
352 |
|
|
int DelDomainACL(struct acl_info *ptr); |
353 |
|
|
int DeleteDomain(char *data); |
354 |
kumaneko |
214 |
int DumpCondition(struct io_buffer *head, const struct condition_list *ptr); |
355 |
kumaneko |
111 |
int IsCorrectDomain(const unsigned char *domainname, const char *function); |
356 |
|
|
int IsCorrectPath(const char *filename, const int start_type, const int pattern_type, const int end_type, const char *function); |
357 |
|
|
int IsDomainDef(const unsigned char *buffer); |
358 |
|
|
int PathMatchesToPattern(const struct path_info *pathname0, const struct path_info *pattern0); |
359 |
|
|
int PollGrantLog(struct file *file, poll_table *wait); |
360 |
|
|
int PollRejectLog(struct file *file, poll_table *wait); |
361 |
kumaneko |
214 |
int ReadAddressGroupPolicy(struct io_buffer *head); |
362 |
|
|
int ReadAggregatorPolicy(struct io_buffer *head); |
363 |
|
|
int ReadAliasPolicy(struct io_buffer *head); |
364 |
|
|
int ReadCapabilityStatus(struct io_buffer *head); |
365 |
|
|
int ReadChrootPolicy(struct io_buffer *head); |
366 |
|
|
int ReadDomainInitializerPolicy(struct io_buffer *head); |
367 |
|
|
int ReadDomainKeeperPolicy(struct io_buffer *head); |
368 |
|
|
int ReadGloballyReadablePolicy(struct io_buffer *head); |
369 |
|
|
int ReadGrantLog(struct io_buffer *head); |
370 |
|
|
int ReadGroupPolicy(struct io_buffer *head); |
371 |
|
|
int ReadMountPolicy(struct io_buffer *head); |
372 |
|
|
int ReadNoRewritePolicy(struct io_buffer *head); |
373 |
|
|
int ReadNoUmountPolicy(struct io_buffer *head); |
374 |
|
|
int ReadPatternPolicy(struct io_buffer *head); |
375 |
|
|
int ReadPivotRootPolicy(struct io_buffer *head); |
376 |
|
|
int ReadPermissionMapping(struct io_buffer *head); |
377 |
|
|
int ReadRejectLog(struct io_buffer *head); |
378 |
|
|
int ReadReservedPortPolicy(struct io_buffer *head); |
379 |
|
|
int ReadSelfDomain(struct io_buffer *head); |
380 |
kumaneko |
111 |
int SetCapabilityStatus(const char *data, unsigned int value, const unsigned int profile); |
381 |
kumaneko |
214 |
int SetPermissionMapping(struct io_buffer *head); |
382 |
kumaneko |
244 |
int TooManyDomainACL(struct domain_info * const domain); |
383 |
kumaneko |
111 |
int WriteAuditLog(char *log, const int is_granted); |
384 |
|
|
int acltype2paths(const unsigned int acl_type); |
385 |
kumaneko |
214 |
int io_printf(struct io_buffer *head, const char *fmt, ...) __attribute__ ((format(printf, 2, 3))); |
386 |
kumaneko |
111 |
struct domain_info *FindDomain(const char *domainname); |
387 |
|
|
struct domain_info *FindOrAssignNewDomain(const char *domainname, const u8 profile); |
388 |
|
|
struct domain_info *UndeleteDomain(const char *domainname0); |
389 |
|
|
unsigned int CheckCCSAccept(const unsigned int index); |
390 |
|
|
unsigned int CheckCCSEnforce(const unsigned int index); |
391 |
|
|
unsigned int CheckCCSFlags(const unsigned int index); |
392 |
|
|
unsigned int TomoyoVerboseMode(void); |
393 |
|
|
void UpdateCounter(const unsigned char index); |
394 |
|
|
void ccs_free(const void *p); |
395 |
|
|
void fill_path_info(struct path_info *ptr); |
396 |
|
|
|
397 |
|
|
static inline int pathcmp(const struct path_info *a, const struct path_info *b) |
398 |
|
|
{ |
399 |
|
|
return a->hash != b->hash || strcmp(a->name, b->name); |
400 |
|
|
} |
401 |
|
|
#endif |