mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KEYS: unlock tasklist when exiting early from keyctl_session_to_parent
@ 2009-09-12 18:13 Marc Dionne
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Dionne @ 2009-09-12 18:13 UTC (permalink / raw)
  To: David Howells, linux-kernel

When we exit early from keyctl_session_to_parent because of permissions
or because the session keyring is the same as the parent, we need to
unlock the tasklist.

The missing unlock causes the system to hang completely when
using keyctl(KEYCTL_SESSION_TO_PARENT) with a keyring shared with
the parent.

Signed-off-by: Marc Dionne <marc.c.dionne@gmail.com>
---
 security/keys/keyctl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 74c9685..60983f3 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -1319,6 +1319,7 @@ long keyctl_session_to_parent(void)
 already_same:
 	ret = 0;
 not_permitted:
+	write_unlock_irq(&tasklist_lock);
 	put_cred(cred);
 	return ret;
 
-- 
1.6.4.2


^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH] KEYS: Unlock tasklist when exiting early from keyctl_session_to_parent
@ 2009-09-14 11:46 David Howells
  0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2009-09-14 11:46 UTC (permalink / raw)
  To: torvalds, jmorris
  Cc: linux-security-module, linux-kernel, Marc Dionne, David Howells

From: Marc Dionne <marc.c.dionne@gmail.com>

When we exit early from keyctl_session_to_parent because of permissions or
because the session keyring is the same as the parent, we need to unlock the
tasklist.

The missing unlock causes the system to hang completely when using
keyctl(KEYCTL_SESSION_TO_PARENT) with a keyring shared with the parent.

Signed-off-by: Marc Dionne <marc.c.dionne@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 security/keys/keyctl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 74c9685..60983f3 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -1319,6 +1319,7 @@ long keyctl_session_to_parent(void)
 already_same:
 	ret = 0;
 not_permitted:
+	write_unlock_irq(&tasklist_lock);
 	put_cred(cred);
 	return ret;
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-14 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-12 18:13 [PATCH] KEYS: unlock tasklist when exiting early from keyctl_session_to_parent Marc Dionne
2009-09-14 11:46 [PATCH] KEYS: Unlock " David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®