aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.h
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2011-09-16 09:54:25 -0400
committerJames Morris <jmorris@namei.org>2011-09-18 20:09:59 -0400
commit6bce98edc3365a8f780ff3944ac7992544c194fe (patch)
treeee10abf2345f651d65d7f10fd385c01e0dc891b3 /security/tomoyo/common.h
parentcc100551b4d92f47abebfa7c7918b2be71263b4a (diff)
TOMOYO: Allow specifying domain transition preference.
I got an opinion that it is difficult to use exception policy's domain transition control directives because they need to match the pathname specified to "file execute" directives. For example, if "file execute /bin/\*\-ls\-cat" is given, corresponding domain transition control directive needs to be like "no_keep_domain /bin/\*\-ls\-cat from any". If we can specify like below, it will become more convenient. file execute /bin/ls keep exec.realpath="/bin/ls" exec.argv[0]="ls" file execute /bin/cat keep exec.realpath="/bin/cat" exec.argv[0]="cat" file execute /bin/\*\-ls\-cat child file execute /usr/sbin/httpd <apache> exec.realpath="/usr/sbin/httpd" exec.argv[0]="/usr/sbin/httpd" In above examples, "keep" works as if keep_domain is specified, "child" works as if "no_reset_domain" and "no_initialize_domain" and "no_keep_domain" are specified, "<apache>" causes domain transition to <apache> domain upon successful execve() operation. Moreover, we can also allow transition to different domains based on conditions like below example. <kernel> /usr/sbin/sshd file execute /bin/bash <kernel> /usr/sbin/sshd //batch-session exec.argc=2 exec.argv[1]="-c" file execute /bin/bash <kernel> /usr/sbin/sshd //root-session task.uid=0 file execute /bin/bash <kernel> /usr/sbin/sshd //nonroot-session task.uid!=0 Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/common.h')
-rw-r--r--security/tomoyo/common.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index 471c9f9afc18..a2bc33fc60b6 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -615,6 +615,7 @@ struct tomoyo_execve {
615 struct tomoyo_request_info r; 615 struct tomoyo_request_info r;
616 struct tomoyo_obj_info obj; 616 struct tomoyo_obj_info obj;
617 struct linux_binprm *bprm; 617 struct linux_binprm *bprm;
618 const struct tomoyo_path_info *transition;
618 /* For dumping argv[] and envp[]. */ 619 /* For dumping argv[] and envp[]. */
619 struct tomoyo_page_dump dump; 620 struct tomoyo_page_dump dump;
620 /* For temporary use. */ 621 /* For temporary use. */
@@ -650,6 +651,7 @@ struct tomoyo_condition {
650 u16 argc; /* Number of "struct tomoyo_argv". */ 651 u16 argc; /* Number of "struct tomoyo_argv". */
651 u16 envc; /* Number of "struct tomoyo_envp". */ 652 u16 envc; /* Number of "struct tomoyo_envp". */
652 u8 grant_log; /* One of values in "enum tomoyo_grant_log". */ 653 u8 grant_log; /* One of values in "enum tomoyo_grant_log". */
654 const struct tomoyo_path_info *transit; /* Maybe NULL. */
653 /* 655 /*
654 * struct tomoyo_condition_element condition[condc]; 656 * struct tomoyo_condition_element condition[condc];
655 * struct tomoyo_number_union values[numbers_count]; 657 * struct tomoyo_number_union values[numbers_count];
@@ -956,6 +958,8 @@ int tomoyo_check_open_permission(struct tomoyo_domain_info *domain,
956 struct path *path, const int flag); 958 struct path *path, const int flag);
957int tomoyo_close_control(struct tomoyo_io_buffer *head); 959int tomoyo_close_control(struct tomoyo_io_buffer *head);
958int tomoyo_env_perm(struct tomoyo_request_info *r, const char *env); 960int tomoyo_env_perm(struct tomoyo_request_info *r, const char *env);
961int tomoyo_execute_permission(struct tomoyo_request_info *r,
962 const struct tomoyo_path_info *filename);
959int tomoyo_find_next_domain(struct linux_binprm *bprm); 963int tomoyo_find_next_domain(struct linux_binprm *bprm);
960int tomoyo_get_mode(const struct tomoyo_policy_namespace *ns, const u8 profile, 964int tomoyo_get_mode(const struct tomoyo_policy_namespace *ns, const u8 profile,
961 const u8 index); 965 const u8 index);