key_ref = lookup_user_key(NULL, id, 1, 1, 0); 
key_ref = lookup_user_key(NULL, id, 1, 1, KEY_SETATTR); 
long keyctl_setperm_key(key_serial_t id, key_perm_t perm){	struct key *key;	key_ref_t key_ref;	long ret;	ret = -EINVAL;	if (perm & ~(KEY_POS_ALL | KEY_USR_ALL | KEY_GRP_ALL | KEY_OTH_ALL))		goto error;	key_ref = lookup_user_key(NULL, id, 1, 1, 0);	if (IS_ERR(key_ref)) {		ret = PTR_ERR(key_ref);		goto error;	}	key = key_ref_to_ptr(key_ref);	/* make the changes with the locks held to prevent chown/chmod races */	ret = -EACCES;	down_write(&key->sem);	/* if we're not the sysadmin, we can only change a key that we own */	if (capable(CAP_SYS_ADMIN) || key->uid == current->fsuid) {		key->perm = perm;		ret = 0;	}	up_write(&key->sem);	key_put(key);error:	return ret;} /* end keyctl_setperm_key() */
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/29db9190634067c5a328ee5fcc2890251b836b4b/keyctl.c/buggy/security/keys/keyctl.c