From: David Howells <dhowells@redhat.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: dhowells@redhat.com, torvalds@osdl.org,
akpm@linux-foundation.org, keyrings@linux-nfs.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KEYS: The request_key() syscall should link an existing key to the dest keyring
Date: Wed, 28 Apr 2010 15:58:49 +0100 [thread overview]
Message-ID: <14312.1272466729@redhat.com> (raw)
In-Reply-To: <i2s19f34abd1004280504n5b0eec52h1452a29726841e53@mail.gmail.com>
Vegard Nossum <vegard.nossum@gmail.com> wrote:
> 1. Is it correct to return -EINPROGRESS in this case?
Yes - it prevents construct_key_and_link() from going on to call
construct_key(). The key in question is returned in *_key.
However, I don't think I handle other errors coming back from
construct_alloc_key() correctly.
> 2. (Why) Shouldn't the return value of __key_link() be checked?
It should. In fact, I should probably precheck and preallocate the keyring to
make sure I don't get errors after allocating the new key.
> 3. In __key_link(), shouldn't rcu_dereference() be used when accessing
> keyring->payload.subscriptions?
No. We have to hold a write lock on the keyring semaphore if we're going to
call __key_link() to add something to it.
We should, however, call rcu_dereference_protected().
You should find a patch for this in your inbox.
David
next prev parent reply other threads:[~2010-04-28 14:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-26 14:59 [PATCH] KEYS: The request_key() syscall should link an existing key to the dest keyring David Howells
2010-04-28 12:04 ` Vegard Nossum
2010-04-28 14:58 ` David Howells [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-04-26 15:44 David Howells
2010-04-26 23:09 ` Andrew Morton
2010-04-27 10:15 ` 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=14312.1272466729@redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=keyrings@linux-nfs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=vegard.nossum@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.