aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.h
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-05-05 23:40:02 -0400
committerJames Morris <jmorris@namei.org>2010-05-10 03:59:02 -0400
commit9e4b50e93786d00c703f16ed46e6a4029c0dfdd1 (patch)
tree51bf6072802888592ae98b9a6c8a26fcb2e1988f /security/tomoyo/common.h
parent83c36ccfe4d849f482ea0a62402c7624f4e59f0e (diff)
TOMOYO: Use stack memory for pending entry.
Use stack memory for pending entry to reduce kmalloc() which will be kfree()d. 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.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index 52c9502ed675..c95f48609461 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -616,6 +616,7 @@ char *tomoyo_realpath_from_path(struct path *path);
616 616
617/* Check memory quota. */ 617/* Check memory quota. */
618bool tomoyo_memory_ok(void *ptr); 618bool tomoyo_memory_ok(void *ptr);
619void *tomoyo_commit_ok(void *data, const unsigned int size);
619 620
620/* 621/*
621 * Keep the given name on the RAM. 622 * Keep the given name on the RAM.
@@ -735,6 +736,31 @@ static inline struct tomoyo_domain_info *tomoyo_real_domain(struct task_struct
735 return task_cred_xxx(task, security); 736 return task_cred_xxx(task, security);
736} 737}
737 738
739static inline bool tomoyo_is_same_domain_initializer_entry
740(const struct tomoyo_domain_initializer_entry *p1,
741 const struct tomoyo_domain_initializer_entry *p2)
742{
743 return p1->is_not == p2->is_not && p1->is_last_name == p2->is_last_name
744 && p1->domainname == p2->domainname
745 && p1->program == p2->program;
746}
747
748static inline bool tomoyo_is_same_domain_keeper_entry
749(const struct tomoyo_domain_keeper_entry *p1,
750 const struct tomoyo_domain_keeper_entry *p2)
751{
752 return p1->is_not == p2->is_not && p1->is_last_name == p2->is_last_name
753 && p1->domainname == p2->domainname
754 && p1->program == p2->program;
755}
756
757static inline bool tomoyo_is_same_alias_entry
758(const struct tomoyo_alias_entry *p1, const struct tomoyo_alias_entry *p2)
759{
760 return p1->original_name == p2->original_name &&
761 p1->aliased_name == p2->aliased_name;
762}
763
738/** 764/**
739 * list_for_each_cookie - iterate over a list with cookie. 765 * list_for_each_cookie - iterate over a list with cookie.
740 * @pos: the &struct list_head to use as a loop cursor. 766 * @pos: the &struct list_head to use as a loop cursor.