Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192441
b: refs/heads/master
c: 553d603
h: refs/heads/master
i:
  192439: 6ed312e
v: v3
  • Loading branch information
David Howells authored and James Morris committed May 6, 2010
1 parent fa4e81e commit 976baec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ffbe2699cda6afbe08501098dff8a8c2fe6ae09
refs/heads/master: 553d603c8fce8cf727eb26e4bf6b9549cd4623f1
16 changes: 9 additions & 7 deletions trunk/security/keys/keyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,13 +705,14 @@ int __key_link(struct key *keyring, struct key *key)
if (keyring->type != &key_type_keyring)
goto error;

/* serialise link/link calls to prevent parallel calls causing a
* cycle when applied to two keyring in opposite orders */
down_write(&keyring_serialise_link_sem);

/* check that we aren't going to create a cycle adding one keyring to
* another */
/* do some special keyring->keyring link checks */
if (key->type == &key_type_keyring) {
/* serialise link/link calls to prevent parallel calls causing
* a cycle when applied to two keyring in opposite orders */
down_write(&keyring_serialise_link_sem);

/* check that we aren't going to create a cycle adding one
* keyring to another */
ret = keyring_detect_cycle(keyring, key);
if (ret < 0)
goto error2;
Expand Down Expand Up @@ -814,7 +815,8 @@ int __key_link(struct key *keyring, struct key *key)
done:
ret = 0;
error2:
up_write(&keyring_serialise_link_sem);
if (key->type == &key_type_keyring)
up_write(&keyring_serialise_link_sem);
error:
return ret;

Expand Down

0 comments on commit 976baec

Please sign in to comment.