if (ret == -EAGAIN) ret = -EACCES; 
long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen){	struct key *key, *skey;	long ret;	/* find the key first */	key = lookup_user_key(NULL, keyid, 0, 0, 0);	if (!IS_ERR(key)) {		/* see if we can read it directly */		if (key_permission(key, KEY_READ))			goto can_read_key;		/* we can't; see if it's searchable from this process's		 * keyrings		 * - we automatically take account of the fact that it may be		 *   dangling off an instantiation key		 */		skey = search_process_keyrings(key->type, key,					       keyctl_read_key_same, current);		if (!IS_ERR(skey))			goto can_read_key2;		ret = PTR_ERR(skey);		goto error2;	}	ret = -ENOKEY;	goto error;	/* the key is probably readable - now try to read it */ can_read_key2:	key_put(skey); can_read_key:	ret = key_validate(key);	if (ret == 0) {		ret = -EOPNOTSUPP;		if (key->type->read) {			/* read the data with the semaphore held (since we			 * might sleep) */			down_read(&key->sem);			ret = key->type->read(key, buffer, buflen);			up_read(&key->sem);		}	} error2:	key_put(key); error:	return ret;} /* end keyctl_read_key() */
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/1260f801b4e4ba7be200886b4a53d730de05ca19/keyctl.c/buggy/security/keys/keyctl.c