aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.h
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2011-07-08 00:23:44 -0400
committerJames Morris <jmorris@namei.org>2011-07-10 21:05:33 -0400
commit2ca9bf453bdd478bcb6c01aa2d0bd4c2f4350563 (patch)
treeb9f6051059a2a90547a4501bf296b0cf3c9dbc76 /security/tomoyo/common.h
parent8761afd49ebff8ae04c1a7888af090177441d07d (diff)
TOMOYO: Allow using executable's realpath and symlink's target as conditions.
This patch adds support for permission checks using executable file's realpath upon execve() and symlink's target upon symlink(). Hooks are in the last patch of this pathset. 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.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index 5a0fcedb332b..7e56e6b364e5 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -73,6 +73,8 @@ enum tomoyo_conditions_index {
73 TOMOYO_MODE_OTHERS_READ, /* S_IROTH */ 73 TOMOYO_MODE_OTHERS_READ, /* S_IROTH */
74 TOMOYO_MODE_OTHERS_WRITE, /* S_IWOTH */ 74 TOMOYO_MODE_OTHERS_WRITE, /* S_IWOTH */
75 TOMOYO_MODE_OTHERS_EXECUTE, /* S_IXOTH */ 75 TOMOYO_MODE_OTHERS_EXECUTE, /* S_IXOTH */
76 TOMOYO_EXEC_REALPATH,
77 TOMOYO_SYMLINK_TARGET,
76 TOMOYO_PATH1_UID, 78 TOMOYO_PATH1_UID,
77 TOMOYO_PATH1_GID, 79 TOMOYO_PATH1_GID,
78 TOMOYO_PATH1_INO, 80 TOMOYO_PATH1_INO,
@@ -101,6 +103,7 @@ enum tomoyo_conditions_index {
101 TOMOYO_PATH2_PARENT_PERM, 103 TOMOYO_PATH2_PARENT_PERM,
102 TOMOYO_MAX_CONDITION_KEYWORD, 104 TOMOYO_MAX_CONDITION_KEYWORD,
103 TOMOYO_NUMBER_UNION, 105 TOMOYO_NUMBER_UNION,
106 TOMOYO_NAME_UNION,
104}; 107};
105 108
106 109
@@ -351,6 +354,11 @@ struct tomoyo_request_info {
351 * NULL if not dealing files. 354 * NULL if not dealing files.
352 */ 355 */
353 struct tomoyo_obj_info *obj; 356 struct tomoyo_obj_info *obj;
357 /*
358 * For holding parameters specific to execve() request.
359 * NULL if not dealing do_execve().
360 */
361 struct tomoyo_execve *ee;
354 struct tomoyo_domain_info *domain; 362 struct tomoyo_domain_info *domain;
355 /* For holding parameters. */ 363 /* For holding parameters. */
356 union { 364 union {
@@ -476,6 +484,20 @@ struct tomoyo_obj_info {
476 * parent directory. 484 * parent directory.
477 */ 485 */
478 struct tomoyo_mini_stat stat[TOMOYO_MAX_PATH_STAT]; 486 struct tomoyo_mini_stat stat[TOMOYO_MAX_PATH_STAT];
487 /*
488 * Content of symbolic link to be created. NULL for operations other
489 * than symlink().
490 */
491 struct tomoyo_path_info *symlink_target;
492};
493
494/* Structure for execve() operation. */
495struct tomoyo_execve {
496 struct tomoyo_request_info r;
497 struct tomoyo_obj_info obj;
498 struct linux_binprm *bprm;
499 /* For temporary use. */
500 char *tmp; /* Size is TOMOYO_EXEC_TMPSIZE bytes */
479}; 501};
480 502
481/* Structure for entries which follows "struct tomoyo_condition". */ 503/* Structure for entries which follows "struct tomoyo_condition". */
@@ -494,9 +516,11 @@ struct tomoyo_condition {
494 u32 size; /* Memory size allocated for this entry. */ 516 u32 size; /* Memory size allocated for this entry. */
495 u16 condc; /* Number of conditions in this struct. */ 517 u16 condc; /* Number of conditions in this struct. */
496 u16 numbers_count; /* Number of "struct tomoyo_number_union values". */ 518 u16 numbers_count; /* Number of "struct tomoyo_number_union values". */
519 u16 names_count; /* Number of "struct tomoyo_name_union names". */
497 /* 520 /*
498 * struct tomoyo_condition_element condition[condc]; 521 * struct tomoyo_condition_element condition[condc];
499 * struct tomoyo_number_union values[numbers_count]; 522 * struct tomoyo_number_union values[numbers_count];
523 * struct tomoyo_name_union names[names_count];
500 */ 524 */
501}; 525};
502 526