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.h32
1 files changed, 20 insertions, 12 deletions
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index 7aa55eef67bd..6f9711ff73c1 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -397,6 +397,13 @@ struct tomoyo_mount_acl {
397 struct tomoyo_number_union flags; 397 struct tomoyo_number_union flags;
398}; 398};
399 399
400/* Structure for holding a line from /sys/kernel/security/tomoyo/ interface. */
401struct tomoyo_acl_param {
402 char *data;
403 struct list_head *list;
404 bool is_delete;
405};
406
400#define TOMOYO_MAX_IO_READ_QUEUE 32 407#define TOMOYO_MAX_IO_READ_QUEUE 32
401 408
402/* 409/*
@@ -521,7 +528,7 @@ bool tomoyo_correct_domain(const unsigned char *domainname);
521bool tomoyo_correct_path(const char *filename); 528bool tomoyo_correct_path(const char *filename);
522bool tomoyo_correct_word(const char *string); 529bool tomoyo_correct_word(const char *string);
523bool tomoyo_domain_def(const unsigned char *buffer); 530bool tomoyo_domain_def(const unsigned char *buffer);
524bool tomoyo_parse_name_union(const char *filename, 531bool tomoyo_parse_name_union(struct tomoyo_acl_param *param,
525 struct tomoyo_name_union *ptr); 532 struct tomoyo_name_union *ptr);
526const struct tomoyo_path_info * 533const struct tomoyo_path_info *
527tomoyo_path_matches_group(const struct tomoyo_path_info *pathname, 534tomoyo_path_matches_group(const struct tomoyo_path_info *pathname,
@@ -531,7 +538,8 @@ bool tomoyo_number_matches_group(const unsigned long min,
531 const struct tomoyo_group *group); 538 const struct tomoyo_group *group);
532bool tomoyo_path_matches_pattern(const struct tomoyo_path_info *filename, 539bool tomoyo_path_matches_pattern(const struct tomoyo_path_info *filename,
533 const struct tomoyo_path_info *pattern); 540 const struct tomoyo_path_info *pattern);
534bool tomoyo_parse_number_union(char *data, struct tomoyo_number_union *num); 541bool tomoyo_parse_number_union(struct tomoyo_acl_param *param,
542 struct tomoyo_number_union *ptr);
535bool tomoyo_tokenize(char *buffer, char *w[], size_t size); 543bool tomoyo_tokenize(char *buffer, char *w[], size_t size);
536bool tomoyo_verbose_mode(const struct tomoyo_domain_info *domain); 544bool tomoyo_verbose_mode(const struct tomoyo_domain_info *domain);
537int tomoyo_init_request_info(struct tomoyo_request_info *r, 545int tomoyo_init_request_info(struct tomoyo_request_info *r,
@@ -540,21 +548,19 @@ int tomoyo_init_request_info(struct tomoyo_request_info *r,
540int tomoyo_mount_permission(char *dev_name, struct path *path, 548int tomoyo_mount_permission(char *dev_name, struct path *path,
541 const char *type, unsigned long flags, 549 const char *type, unsigned long flags,
542 void *data_page); 550 void *data_page);
543int tomoyo_write_aggregator(char *data, const bool is_delete); 551int tomoyo_write_aggregator(struct tomoyo_acl_param *param);
544int tomoyo_write_transition_control(char *data, const bool is_delete, 552int tomoyo_write_transition_control(struct tomoyo_acl_param *param,
545 const u8 type); 553 const u8 type);
546int tomoyo_write_file(char *data, struct tomoyo_domain_info *domain, 554int tomoyo_write_file(struct tomoyo_acl_param *param);
547 const bool is_delete); 555int tomoyo_write_group(struct tomoyo_acl_param *param, const u8 type);
548int tomoyo_write_mount(char *data, struct tomoyo_domain_info *domain,
549 const bool is_delete);
550int tomoyo_write_group(char *data, const bool is_delete, const u8 type);
551int tomoyo_supervisor(struct tomoyo_request_info *r, const char *fmt, ...) 556int tomoyo_supervisor(struct tomoyo_request_info *r, const char *fmt, ...)
552 __attribute__ ((format(printf, 2, 3))); 557 __attribute__ ((format(printf, 2, 3)));
553struct tomoyo_domain_info *tomoyo_find_domain(const char *domainname); 558struct tomoyo_domain_info *tomoyo_find_domain(const char *domainname);
554struct tomoyo_domain_info *tomoyo_assign_domain(const char *domainname, 559struct tomoyo_domain_info *tomoyo_assign_domain(const char *domainname,
555 const u8 profile); 560 const u8 profile);
556struct tomoyo_profile *tomoyo_profile(const u8 profile); 561struct tomoyo_profile *tomoyo_profile(const u8 profile);
557struct tomoyo_group *tomoyo_get_group(const char *group_name, const u8 type); 562struct tomoyo_group *tomoyo_get_group(struct tomoyo_acl_param *param,
563 const u8 idx);
558unsigned int tomoyo_check_flags(const struct tomoyo_domain_info *domain, 564unsigned int tomoyo_check_flags(const struct tomoyo_domain_info *domain,
559 const u8 index); 565 const u8 index);
560void tomoyo_fill_path_info(struct tomoyo_path_info *ptr); 566void tomoyo_fill_path_info(struct tomoyo_path_info *ptr);
@@ -587,7 +593,7 @@ void tomoyo_put_name_union(struct tomoyo_name_union *ptr);
587void tomoyo_run_gc(void); 593void tomoyo_run_gc(void);
588void tomoyo_memory_free(void *ptr); 594void tomoyo_memory_free(void *ptr);
589int tomoyo_update_domain(struct tomoyo_acl_info *new_entry, const int size, 595int tomoyo_update_domain(struct tomoyo_acl_info *new_entry, const int size,
590 bool is_delete, struct tomoyo_domain_info *domain, 596 struct tomoyo_acl_param *param,
591 bool (*check_duplicate) (const struct tomoyo_acl_info 597 bool (*check_duplicate) (const struct tomoyo_acl_info
592 *, 598 *,
593 const struct tomoyo_acl_info 599 const struct tomoyo_acl_info
@@ -596,7 +602,7 @@ int tomoyo_update_domain(struct tomoyo_acl_info *new_entry, const int size,
596 struct tomoyo_acl_info *, 602 struct tomoyo_acl_info *,
597 const bool)); 603 const bool));
598int tomoyo_update_policy(struct tomoyo_acl_head *new_entry, const int size, 604int tomoyo_update_policy(struct tomoyo_acl_head *new_entry, const int size,
599 bool is_delete, struct list_head *list, 605 struct tomoyo_acl_param *param,
600 bool (*check_duplicate) (const struct tomoyo_acl_head 606 bool (*check_duplicate) (const struct tomoyo_acl_head
601 *, 607 *,
602 const struct tomoyo_acl_head 608 const struct tomoyo_acl_head
@@ -604,6 +610,8 @@ int tomoyo_update_policy(struct tomoyo_acl_head *new_entry, const int size,
604void tomoyo_check_acl(struct tomoyo_request_info *r, 610void tomoyo_check_acl(struct tomoyo_request_info *r,
605 bool (*check_entry) (struct tomoyo_request_info *, 611 bool (*check_entry) (struct tomoyo_request_info *,
606 const struct tomoyo_acl_info *)); 612 const struct tomoyo_acl_info *));
613char *tomoyo_read_token(struct tomoyo_acl_param *param);
614bool tomoyo_permstr(const char *string, const char *keyword);
607 615
608/********** External variable definitions. **********/ 616/********** External variable definitions. **********/
609 617