From: "David Härdeman" <david@2gen.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 03/04] Add encryption ops to the keyctl syscall
Date: Wed, 25 Jan 2006 21:40:38 +0100 [thread overview]
Message-ID: <20060125204038.GC12039@hardeman.nu> (raw)
In-Reply-To: <17515.1138100304@hades.cambridge.redhat.com>
On Tue, Jan 24, 2006 at 10:58:24AM +0000, David Howells wrote:
>> + key = key_ref_to_ptr(key_ref);
>> +
>> + /* see if we can read it directly */
>> + ret = key_permission(key_ref, KEY_READ);
>
>You don't actually need to calculate key until after you've done all those
>checks, so I'd move it further down the file. You can use the function to
>release key references in the error handling or have a separate error handling
>return path.
Do you mean that I should move the key_ref_to_ptr call to right after
the can_read_key label? If that is the case, shouldn't the same thing be
done for keyctl_read_key?
>> + down_read(&key->sem);
>> + ret = key->type->encrypt(key, data, dlen, result, rlen);
>> + up_read(&key->sem);
>
>Do we really want to restrict the key type implementor to using the r/w
>semaphore. Would it be better to let the type decide whether it wants to use
>the semaphore or let it use RCU if it so desires?
Ok, I'll move the semaphore into the dsa key type instead and change the
appropriate comments.
Re,
David
next prev parent reply other threads:[~2006-01-25 20:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <11380489522552@2gen.com>
2006-01-23 20:42 ` [PATCH 02/04] Add dsa crypto ops David Härdeman
2006-01-23 20:42 ` [PATCH 03/04] Add encryption ops to the keyctl syscall David Härdeman
2006-01-23 20:42 ` [PATCH 04/04] Add dsa key type David Härdeman
2006-01-24 11:08 ` David Howells
2006-01-25 19:14 ` David Härdeman
2006-01-26 9:41 ` David Howells
2006-01-24 4:33 ` [PATCH 03/04] Add encryption ops to the keyctl syscall Randy.Dunlap
2006-01-24 10:58 ` David Howells
2006-01-25 20:40 ` David Härdeman [this message]
2006-01-26 9:43 ` David Howells
2006-01-24 11:09 ` David Howells
2006-01-24 1:22 ` [PATCH 02/04] Add dsa crypto ops Herbert Xu
2006-01-24 6:49 ` David Härdeman
2006-01-24 10:37 ` [PATCH 01/04] Add multi-precision-integer maths library David Howells
2006-01-25 20:46 ` David Härdeman
2006-01-26 9:45 ` David Howells
2006-01-26 21:58 [PATCH 00/04] Add DSA key type David Härdeman
2006-01-26 21:58 ` [PATCH 03/04] Add encryption ops to the keyctl syscall David Härdeman
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=20060125204038.GC12039@hardeman.nu \
--to=david@2gen.com \
--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