lkml.org 
[lkml]   [2011]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC][PATCH v3 6/6] eCryptfs: added support for the encrypted key type
Date
Roberto Sassu <roberto.sassu@polito.it> wrote:

> (*auth_tok_key) = request_key(&key_type_user, sig, NULL);
> if (!(*auth_tok_key) || IS_ERR(*auth_tok_key)) {
> - printk(KERN_ERR "Could not find key with description: [%s]\n",
> - sig);
> - rc = process_request_key_err(PTR_ERR(*auth_tok_key));
> - goto out;
> + (*auth_tok_key) = ecryptfs_get_encrypted_key(sig);
> + if (!(*auth_tok_key) || IS_ERR(*auth_tok_key)) {
> + printk(KERN_ERR "Could not find key with description: [%s]\n",
> + sig);
> + rc = process_request_key_err(PTR_ERR(*auth_tok_key));
> + goto out;
> + }
> }
> (*auth_tok) = ecryptfs_get_key_payload_data(*auth_tok_key);
> if (ecryptfs_verify_version((*auth_tok)->version)) {

You need some locking here, even if it's only use of the RCU read lock.
Encrypted-type keys have an update method and so may change under you.

David
---


\
 
 \ /
  Last update: 2011-01-26 12:31    [W:0.117 / U:3.496 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site