aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/gc.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2011-07-08 00:24:54 -0400
committerJames Morris <jmorris@namei.org>2011-07-10 21:05:33 -0400
commit5b636857fee642694e287e3a181b523b16098c93 (patch)
tree24afcc11fc35350a29f5d6d73d376a551c5569b8 /security/tomoyo/gc.c
parent2ca9bf453bdd478bcb6c01aa2d0bd4c2f4350563 (diff)
TOMOYO: Allow using argv[]/envp[] of execve() as conditions.
This patch adds support for permission checks using argv[]/envp[] of execve() request. 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/gc.c')
-rw-r--r--security/tomoyo/gc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/security/tomoyo/gc.c b/security/tomoyo/gc.c
index e0502b6d586..1ac3312059f 100644
--- a/security/tomoyo/gc.c
+++ b/security/tomoyo/gc.c
@@ -358,6 +358,8 @@ void tomoyo_del_condition(struct list_head *element)
358 const u16 condc = cond->condc; 358 const u16 condc = cond->condc;
359 const u16 numbers_count = cond->numbers_count; 359 const u16 numbers_count = cond->numbers_count;
360 const u16 names_count = cond->names_count; 360 const u16 names_count = cond->names_count;
361 const u16 argc = cond->argc;
362 const u16 envc = cond->envc;
361 unsigned int i; 363 unsigned int i;
362 const struct tomoyo_condition_element *condp 364 const struct tomoyo_condition_element *condp
363 = (const struct tomoyo_condition_element *) (cond + 1); 365 = (const struct tomoyo_condition_element *) (cond + 1);
@@ -365,10 +367,20 @@ void tomoyo_del_condition(struct list_head *element)
365 = (struct tomoyo_number_union *) (condp + condc); 367 = (struct tomoyo_number_union *) (condp + condc);
366 struct tomoyo_name_union *names_p 368 struct tomoyo_name_union *names_p
367 = (struct tomoyo_name_union *) (numbers_p + numbers_count); 369 = (struct tomoyo_name_union *) (numbers_p + numbers_count);
370 const struct tomoyo_argv *argv
371 = (const struct tomoyo_argv *) (names_p + names_count);
372 const struct tomoyo_envp *envp
373 = (const struct tomoyo_envp *) (argv + argc);
368 for (i = 0; i < numbers_count; i++) 374 for (i = 0; i < numbers_count; i++)
369 tomoyo_put_number_union(numbers_p++); 375 tomoyo_put_number_union(numbers_p++);
370 for (i = 0; i < names_count; i++) 376 for (i = 0; i < names_count; i++)
371 tomoyo_put_name_union(names_p++); 377 tomoyo_put_name_union(names_p++);
378 for (i = 0; i < argc; argv++, i++)
379 tomoyo_put_name(argv->value);
380 for (i = 0; i < envc; envp++, i++) {
381 tomoyo_put_name(envp->name);
382 tomoyo_put_name(envp->value);
383 }
372} 384}
373 385
374/** 386/**