public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Nyberg <alexn@dsv.su.se>
To: dhowells@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: Race against parent deletion in key_user_lookup()
Date: Wed, 09 Mar 2005 12:17:59 +0100	[thread overview]
Message-ID: <1110367079.2294.8.camel@boxen> (raw)

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 */



             reply	other threads:[~2005-03-09 11:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-09 11:17 Alexander Nyberg [this message]
2005-03-09 12:02 ` Race against parent deletion in key_user_lookup() David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1110367079.2294.8.camel@boxen \
    --to=alexn@dsv.su.se \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox