Skip to contentSkip to conversation

KEYS: unlock tasklist when exiting early from keyctl_session_to_parent

PATCH New Marc Dionne 1 participant 1 message Sep 12, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KEYS: unlock tasklist when exiting early from keyctl_session_to_parent

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.

---
 security/keys/keyctl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
security/keys/keyctl.c +1 -0
index 74c9685..60983f3 100644
@@ -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;
 
Signature · 1 line
1.6.4.2