aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2012-08-26 15:12:14 -0400
committerIngo Molnar <mingo@kernel.org>2012-09-13 10:47:36 -0400
commitb3f68f16dbcde6fcdf0fd27695391ff7e9d41233 (patch)
tree26833634b038b8fd9d18f109deb10770eb3f2a6e /security
parent9da33de62431c7839f98156720862262272a8380 (diff)
task_work: Revert "hold task_lock around checks in keyctl"
This reverts commit d35abdb28824cf74f0a106a0f9c6f3ff700a35bf. task_lock() was added to ensure exit_mm() and thus exit_task_work() is not possible before task_work_add(). This is wrong, task_lock() must not be nested with write_lock(tasklist). And this is no longer needed, task_work_add() now fails if it is called after exit_task_work(). Reported-by: Dave Jones <davej@redhat.com> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/20120826191214.GA4231@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'security')
-rw-r--r--security/keys/keyctl.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 3364fbf46807..6cfc6478863e 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -1486,7 +1486,6 @@ long keyctl_session_to_parent(void)
1486 oldwork = NULL; 1486 oldwork = NULL;
1487 parent = me->real_parent; 1487 parent = me->real_parent;
1488 1488
1489 task_lock(parent);
1490 /* the parent mustn't be init and mustn't be a kernel thread */ 1489 /* the parent mustn't be init and mustn't be a kernel thread */
1491 if (parent->pid <= 1 || !parent->mm) 1490 if (parent->pid <= 1 || !parent->mm)
1492 goto unlock; 1491 goto unlock;
@@ -1530,7 +1529,6 @@ long keyctl_session_to_parent(void)
1530 if (!ret) 1529 if (!ret)
1531 newwork = NULL; 1530 newwork = NULL;
1532unlock: 1531unlock:
1533 task_unlock(parent);
1534 write_unlock_irq(&tasklist_lock); 1532 write_unlock_irq(&tasklist_lock);
1535 rcu_read_unlock(); 1533 rcu_read_unlock();
1536 if (oldwork) 1534 if (oldwork)