aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2011-10-11 01:05:08 -0400
committerJames Morris <jmorris@namei.org>2011-10-11 21:15:18 -0400
commite2b8b25a6795488eba7bb757706b3ac725c31fac (patch)
treef77e43a01891938e8c83b56d2c249a725923b9ec /security/tomoyo/common.c
parente00fb3f7af111d1b3252f7d622213d2e22be65f5 (diff)
TOMOYO: Remove redundant tasklist_lock.
rcu_read_lock() is sufficient for calling find_task_by_pid_ns()/find_task_by_vpid(). 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.c')
-rw-r--r--security/tomoyo/common.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 2e2802060eef..365f3bddee79 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -984,14 +984,12 @@ static bool tomoyo_select_domain(struct tomoyo_io_buffer *head,
984 (global_pid = true, sscanf(data, "global-pid=%u", &pid) == 1)) { 984 (global_pid = true, sscanf(data, "global-pid=%u", &pid) == 1)) {
985 struct task_struct *p; 985 struct task_struct *p;
986 rcu_read_lock(); 986 rcu_read_lock();
987 read_lock(&tasklist_lock);
988 if (global_pid) 987 if (global_pid)
989 p = find_task_by_pid_ns(pid, &init_pid_ns); 988 p = find_task_by_pid_ns(pid, &init_pid_ns);
990 else 989 else
991 p = find_task_by_vpid(pid); 990 p = find_task_by_vpid(pid);
992 if (p) 991 if (p)
993 domain = tomoyo_real_domain(p); 992 domain = tomoyo_real_domain(p);
994 read_unlock(&tasklist_lock);
995 rcu_read_unlock(); 993 rcu_read_unlock();
996 } else if (!strncmp(data, "domain=", 7)) { 994 } else if (!strncmp(data, "domain=", 7)) {
997 if (tomoyo_domain_def(data + 7)) 995 if (tomoyo_domain_def(data + 7))
@@ -1664,14 +1662,12 @@ static void tomoyo_read_pid(struct tomoyo_io_buffer *head)
1664 global_pid = true; 1662 global_pid = true;
1665 pid = (unsigned int) simple_strtoul(buf, NULL, 10); 1663 pid = (unsigned int) simple_strtoul(buf, NULL, 10);
1666 rcu_read_lock(); 1664 rcu_read_lock();
1667 read_lock(&tasklist_lock);
1668 if (global_pid) 1665 if (global_pid)
1669 p = find_task_by_pid_ns(pid, &init_pid_ns); 1666 p = find_task_by_pid_ns(pid, &init_pid_ns);
1670 else 1667 else
1671 p = find_task_by_vpid(pid); 1668 p = find_task_by_vpid(pid);
1672 if (p) 1669 if (p)
1673 domain = tomoyo_real_domain(p); 1670 domain = tomoyo_real_domain(p);
1674 read_unlock(&tasklist_lock);
1675 rcu_read_unlock(); 1671 rcu_read_unlock();
1676 if (!domain) 1672 if (!domain)
1677 return; 1673 return;