aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'security/tomoyo/common.h')
-rw-r--r--security/tomoyo/common.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index f7fbaa66e44..63720a328ed 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -196,6 +196,7 @@ enum tomoyo_acl_entry_type_index {
196 TOMOYO_TYPE_PATH_NUMBER_ACL, 196 TOMOYO_TYPE_PATH_NUMBER_ACL,
197 TOMOYO_TYPE_MKDEV_ACL, 197 TOMOYO_TYPE_MKDEV_ACL,
198 TOMOYO_TYPE_MOUNT_ACL, 198 TOMOYO_TYPE_MOUNT_ACL,
199 TOMOYO_TYPE_ENV_ACL,
199}; 200};
200 201
201/* Index numbers for access controls with one pathname. */ 202/* Index numbers for access controls with one pathname. */
@@ -300,12 +301,14 @@ enum tomoyo_mac_index {
300 TOMOYO_MAC_FILE_MOUNT, 301 TOMOYO_MAC_FILE_MOUNT,
301 TOMOYO_MAC_FILE_UMOUNT, 302 TOMOYO_MAC_FILE_UMOUNT,
302 TOMOYO_MAC_FILE_PIVOT_ROOT, 303 TOMOYO_MAC_FILE_PIVOT_ROOT,
304 TOMOYO_MAC_ENVIRON,
303 TOMOYO_MAX_MAC_INDEX 305 TOMOYO_MAX_MAC_INDEX
304}; 306};
305 307
306/* Index numbers for category of functionality. */ 308/* Index numbers for category of functionality. */
307enum tomoyo_mac_category_index { 309enum tomoyo_mac_category_index {
308 TOMOYO_MAC_CATEGORY_FILE, 310 TOMOYO_MAC_CATEGORY_FILE,
311 TOMOYO_MAC_CATEGORY_MISC,
309 TOMOYO_MAX_MAC_CATEGORY_INDEX 312 TOMOYO_MAX_MAC_CATEGORY_INDEX
310}; 313};
311 314
@@ -397,6 +400,9 @@ struct tomoyo_request_info {
397 u8 operation; 400 u8 operation;
398 } path_number; 401 } path_number;
399 struct { 402 struct {
403 const struct tomoyo_path_info *name;
404 } environ;
405 struct {
400 const struct tomoyo_path_info *type; 406 const struct tomoyo_path_info *type;
401 const struct tomoyo_path_info *dir; 407 const struct tomoyo_path_info *dir;
402 const struct tomoyo_path_info *dev; 408 const struct tomoyo_path_info *dev;
@@ -638,6 +644,12 @@ struct tomoyo_mount_acl {
638 struct tomoyo_number_union flags; 644 struct tomoyo_number_union flags;
639}; 645};
640 646
647/* Structure for "misc env" directive in domain policy. */
648struct tomoyo_env_acl {
649 struct tomoyo_acl_info head; /* type = TOMOYO_TYPE_ENV_ACL */
650 const struct tomoyo_path_info *env; /* environment variable */
651};
652
641/* Structure for holding a line from /sys/kernel/security/tomoyo/ interface. */ 653/* Structure for holding a line from /sys/kernel/security/tomoyo/ interface. */
642struct tomoyo_acl_param { 654struct tomoyo_acl_param {
643 char *data; 655 char *data;
@@ -820,6 +832,7 @@ const struct tomoyo_path_info *tomoyo_path_matches_group
820int tomoyo_check_open_permission(struct tomoyo_domain_info *domain, 832int tomoyo_check_open_permission(struct tomoyo_domain_info *domain,
821 struct path *path, const int flag); 833 struct path *path, const int flag);
822int tomoyo_close_control(struct tomoyo_io_buffer *head); 834int tomoyo_close_control(struct tomoyo_io_buffer *head);
835int tomoyo_env_perm(struct tomoyo_request_info *r, const char *env);
823int tomoyo_find_next_domain(struct linux_binprm *bprm); 836int tomoyo_find_next_domain(struct linux_binprm *bprm);
824int tomoyo_get_mode(const struct tomoyo_policy_namespace *ns, const u8 profile, 837int tomoyo_get_mode(const struct tomoyo_policy_namespace *ns, const u8 profile,
825 const u8 index); 838 const u8 index);
@@ -860,6 +873,7 @@ int tomoyo_update_policy(struct tomoyo_acl_head *new_entry, const int size,
860int tomoyo_write_aggregator(struct tomoyo_acl_param *param); 873int tomoyo_write_aggregator(struct tomoyo_acl_param *param);
861int tomoyo_write_file(struct tomoyo_acl_param *param); 874int tomoyo_write_file(struct tomoyo_acl_param *param);
862int tomoyo_write_group(struct tomoyo_acl_param *param, const u8 type); 875int tomoyo_write_group(struct tomoyo_acl_param *param, const u8 type);
876int tomoyo_write_misc(struct tomoyo_acl_param *param);
863int tomoyo_write_transition_control(struct tomoyo_acl_param *param, 877int tomoyo_write_transition_control(struct tomoyo_acl_param *param,
864 const u8 type); 878 const u8 type);
865ssize_t tomoyo_read_control(struct tomoyo_io_buffer *head, char __user *buffer, 879ssize_t tomoyo_read_control(struct tomoyo_io_buffer *head, char __user *buffer,