@@ -44,6 +44,13 @@ struct linux_binprm;
4444/* Profile number is an integer between 0 and 255. */
4545#define TOMOYO_MAX_PROFILES 256
4646
47+ enum tomoyo_mode_index {
48+ TOMOYO_CONFIG_DISABLED ,
49+ TOMOYO_CONFIG_LEARNING ,
50+ TOMOYO_CONFIG_PERMISSIVE ,
51+ TOMOYO_CONFIG_ENFORCING
52+ };
53+
4754/* Keywords for ACLs. */
4855#define TOMOYO_KEYWORD_ALIAS "alias "
4956#define TOMOYO_KEYWORD_ALLOW_READ "allow_read "
@@ -152,6 +159,17 @@ struct tomoyo_page_buffer {
152159 char buffer [4096 ];
153160};
154161
162+ /*
163+ * tomoyo_request_info is a structure which is used for holding
164+ *
165+ * (1) Domain information of current process.
166+ * (2) Access control mode of the profile.
167+ */
168+ struct tomoyo_request_info {
169+ struct tomoyo_domain_info * domain ;
170+ u8 mode ; /* One of tomoyo_mode_index . */
171+ };
172+
155173/*
156174 * tomoyo_path_info is a structure which is used for holding a string data
157175 * used by TOMOYO.
@@ -332,8 +350,8 @@ struct tomoyo_domain_info {
332350 * "allow_read", "allow_write", "allow_create", "allow_unlink", "allow_mkdir",
333351 * "allow_rmdir", "allow_mkfifo", "allow_mksock", "allow_mkblock",
334352 * "allow_mkchar", "allow_truncate", "allow_symlink", "allow_rewrite",
335- * "allow_chmod", "allow_chown", "allow_chgrp", "allow_chroot", "allow_mount"
336- * and "allow_unmount".
353+ * "allow_ioctl", " allow_chmod", "allow_chown", "allow_chgrp", "allow_chroot",
354+ * "allow_mount" and "allow_unmount".
337355 */
338356struct tomoyo_path_acl {
339357 struct tomoyo_acl_info head ; /* type = TOMOYO_TYPE_PATH_ACL */
@@ -567,7 +585,7 @@ struct tomoyo_policy_manager_entry {
567585bool tomoyo_compare_name_union (const struct tomoyo_path_info * name ,
568586 const struct tomoyo_name_union * ptr );
569587/* Check whether the domain has too many ACL entries to hold. */
570- bool tomoyo_domain_quota_is_ok (struct tomoyo_domain_info * const domain );
588+ bool tomoyo_domain_quota_is_ok (struct tomoyo_request_info * r );
571589/* Transactional sprintf() for policy dump. */
572590bool tomoyo_io_printf (struct tomoyo_io_buffer * head , const char * fmt , ...)
573591 __attribute__ ((format (printf , 2 , 3 )));
@@ -623,8 +641,6 @@ bool tomoyo_verbose_mode(const struct tomoyo_domain_info *domain);
623641const char * tomoyo_path22keyword (const u8 operation );
624642/* Get the last component of the given domainname. */
625643const char * tomoyo_get_last_name (const struct tomoyo_domain_info * domain );
626- /* Get warning message. */
627- const char * tomoyo_get_msg (const bool is_enforce );
628644/* Convert single path operation to operation name. */
629645const char * tomoyo_path2keyword (const u8 operation );
630646/* Create "alias" entry in exception policy. */
@@ -723,7 +739,6 @@ int tomoyo_check_open_permission(struct tomoyo_domain_info *domain,
723739int tomoyo_path_perm (const u8 operation , struct path * path );
724740int tomoyo_path2_perm (const u8 operation , struct path * path1 ,
725741 struct path * path2 );
726- int tomoyo_check_rewrite_permission (struct file * filp );
727742int tomoyo_find_next_domain (struct linux_binprm * bprm );
728743
729744/* Drop refcount on tomoyo_name_union. */
0 commit comments