lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 27 Jan 2011 19:59:38 +0100
From:	Roberto Sassu <roberto.sassu@...ito.it>
To:	David Howells <dhowells@...hat.com>
Cc:	linux-security-module@...r.kernel.org, keyrings@...ux-nfs.org,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	jmorris@...ei.org, zohar@...ux.vnet.ibm.com,
	safford@...son.ibm.com, ramunno@...ito.it,
	tyhicks@...ux.vnet.ibm.com, kirkland@...onical.com
Subject: Re: [RFC][PATCH v3 6/6] eCryptfs: added support for the encrypted key type

Hi David

thanks for the review!
I just need a clarification about the comment of this patch.
Regarding the locking issue, this also applies for the unpatched
version of eCryptfs, because the 'user' key type has the
'update' method defined. However, i think the read lock is not
enough because eCryptfs directly writes on the key's payload
in order to update the state of the authentication token.

I've developed a small patch, i will post shortly with Tyler Hicks
in CC, that locks requested keys for writing.

Roberto Sassu


On Wednesday, January 26, 2011 12:28:36 pm David Howells wrote:
> Roberto Sassu <roberto.sassu@...ito.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
> ---
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ