if (!tsk->thread_keyring) { 
if (!context->thread_keyring) { 
struct key *lookup_user_key(key_serial_t id, int create, int partial,			    key_perm_t perm){	struct task_struct *tsk = current;	unsigned long flags;	struct key *key;	int ret;	key = ERR_PTR(-ENOKEY);	switch (id) {	case KEY_SPEC_THREAD_KEYRING:		if (!tsk->thread_keyring) {			if (!create)				goto error;			ret = install_thread_keyring(tsk);			if (ret < 0) {				key = ERR_PTR(ret);				goto error;			}		}		key = tsk->thread_keyring;		atomic_inc(&key->usage);		break;	case KEY_SPEC_PROCESS_KEYRING:		if (!tsk->signal->process_keyring) {			if (!create)				goto error;			ret = install_process_keyring(tsk);			if (ret < 0) {				key = ERR_PTR(ret);				goto error;			}		}		key = tsk->signal->process_keyring;		atomic_inc(&key->usage);		break;	case KEY_SPEC_SESSION_KEYRING:		if (!tsk->signal->session_keyring) {			/* always install a session keyring upon access if one			 * doesn't exist yet */			ret = install_session_keyring(			       tsk, tsk->user->session_keyring);			if (ret < 0)				goto error;		}		spin_lock_irqsave(&tsk->sighand->siglock, flags);		key = tsk->signal->session_keyring;		atomic_inc(&key->usage);		spin_unlock_irqrestore(&tsk->sighand->siglock, flags);		break;	case KEY_SPEC_USER_KEYRING:		key = tsk->user->uid_keyring;		atomic_inc(&key->usage);		break;	case KEY_SPEC_USER_SESSION_KEYRING:		key = tsk->user->session_keyring;		atomic_inc(&key->usage);		break;	case KEY_SPEC_GROUP_KEYRING:		/* group keyrings are not yet supported */		key = ERR_PTR(-EINVAL);		goto error;	default:		key = ERR_PTR(-EINVAL);		if (id < 1)			goto error;		key = key_lookup(id);		if (IS_ERR(key))			goto error;		break;	}	/* check the status and permissions */	if (perm) {		ret = key_validate(key);		if (ret < 0)			goto invalid_key;	}	ret = -EIO;	if (!partial && !test_bit(KEY_FLAG_INSTANTIATED, &key->flags))		goto invalid_key;	ret = -EACCES;	if (!key_permission(key, perm))		goto invalid_key; error:	return key; invalid_key:	key_put(key);	key = ERR_PTR(ret);	goto error;} /* end lookup_user_key() */
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/3e30148c3d524a9c1c63ca28261bc24c457eb07a/process_keys.c/clean/security/keys/process_keys.c