Skip to content

Commit

Permalink
KEYS: Unlock tasklist when exiting early from keyctl_session_to_parent
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
mdionne authored and James Morris committed Sep 14, 2009
1 parent 4a5d6ba commit 5c84342
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions security/keys/keyctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 5c84342

Please sign in to comment.