Skip to content

Commit e2b8b25

Browse files
Tetsuo Handaxjamesmorris
authored andcommitted
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>
1 parent e00fb3f commit e2b8b25

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

‎security/tomoyo/common.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,14 +984,12 @@ static bool tomoyo_select_domain(struct tomoyo_io_buffer *head,
984984
(global_pid = true, sscanf(data, "global-pid=%u", &pid) == 1)) {
985985
struct task_struct *p;
986986
rcu_read_lock();
987-
read_lock(&tasklist_lock);
988987
if (global_pid)
989988
p = find_task_by_pid_ns(pid, &init_pid_ns);
990989
else
991990
p = find_task_by_vpid(pid);
992991
if (p)
993992
domain = tomoyo_real_domain(p);
994-
read_unlock(&tasklist_lock);
995993
rcu_read_unlock();
996994
} else if (!strncmp(data, "domain=", 7)) {
997995
if (tomoyo_domain_def(data + 7))
@@ -1664,14 +1662,12 @@ static void tomoyo_read_pid(struct tomoyo_io_buffer *head)
16641662
global_pid = true;
16651663
pid = (unsigned int) simple_strtoul(buf, NULL, 10);
16661664
rcu_read_lock();
1667-
read_lock(&tasklist_lock);
16681665
if (global_pid)
16691666
p = find_task_by_pid_ns(pid, &init_pid_ns);
16701667
else
16711668
p = find_task_by_vpid(pid);
16721669
if (p)
16731670
domain = tomoyo_real_domain(p);
1674-
read_unlock(&tasklist_lock);
16751671
rcu_read_unlock();
16761672
if (!domain)
16771673
return;

0 commit comments

Comments
 (0)