* Race against parent deletion in key_user_lookup()
@ 2005-03-09 11:17 Alexander Nyberg
2005-03-09 12:02 ` David Howells
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Nyberg @ 2005-03-09 11:17 UTC (permalink / raw)
To: dhowells; +Cc: linux-kernel
I looked at some of the oops reports against keyrings, I think the problem
is that the search isn't restarted after dropping the key_user_lock,
*p will still be NULL when we get back to try_again and look through the tree.
It looks like the intention was that the search start over from scratch.
Signed-off-by: Alexander Nyberg <alexn@dsv.su.se>
===== security/keys/key.c 1.5 vs edited =====
--- 1.5/security/keys/key.c 2005-01-21 06:02:10 +01:00
+++ edited/security/keys/key.c 2005-03-09 12:04:54 +01:00
@@ -57,9 +57,10 @@ struct key_user *key_user_lookup(uid_t u
{
struct key_user *candidate = NULL, *user;
struct rb_node *parent = NULL;
- struct rb_node **p = &key_user_tree.rb_node;
+ struct rb_node **p;
try_again:
+ p = &key_user_tree.rb_node;
spin_lock(&key_user_lock);
/* search the tree for a user record with a matching UID */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Race against parent deletion in key_user_lookup()
2005-03-09 11:17 Race against parent deletion in key_user_lookup() Alexander Nyberg
@ 2005-03-09 12:02 ` David Howells
0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2005-03-09 12:02 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-kernel, Alexander Nyberg
I looked at some of the oops reports against keyrings, I think the problem
is that the search isn't restarted after dropping the key_user_lock,
*p will still be NULL when we get back to try_again and look through the tree.
It looks like the intention was that the search start over from scratch.
Signed-off-by: Alexander Nyberg <alexn@dsv.su.se>
Signed-Off-By: David Howells <dhowells@redhat.com>
===== security/keys/key.c 1.5 vs edited =====
--- 1.5/security/keys/key.c 2005-01-21 06:02:10 +01:00
+++ edited/security/keys/key.c 2005-03-09 12:04:54 +01:00
@@ -57,9 +57,10 @@ struct key_user *key_user_lookup(uid_t u
{
struct key_user *candidate = NULL, *user;
struct rb_node *parent = NULL;
- struct rb_node **p = &key_user_tree.rb_node;
+ struct rb_node **p;
try_again:
+ p = &key_user_tree.rb_node;
spin_lock(&key_user_lock);
/* search the tree for a user record with a matching UID */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-03-09 12:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-09 11:17 Race against parent deletion in key_user_lookup() Alexander Nyberg
2005-03-09 12:02 ` David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox