mirror of https://gitee.com/openkylin/linux.git
security: whitespace coding style fixes
Whitespace coding style fixes. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
parent
822cceec72
commit
c5b60b5e67
|
@ -570,7 +570,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strncmp(name, XATTR_SECURITY_PREFIX,
|
if (!strncmp(name, XATTR_SECURITY_PREFIX,
|
||||||
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
|
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
|
||||||
!capable(CAP_SYS_ADMIN))
|
!capable(CAP_SYS_ADMIN))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -596,7 +596,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strncmp(name, XATTR_SECURITY_PREFIX,
|
if (!strncmp(name, XATTR_SECURITY_PREFIX,
|
||||||
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
|
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
|
||||||
!capable(CAP_SYS_ADMIN))
|
!capable(CAP_SYS_ADMIN))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -469,7 +469,7 @@ struct cgroup_subsys devices_subsys = {
|
||||||
.name = "devices",
|
.name = "devices",
|
||||||
.can_attach = devcgroup_can_attach,
|
.can_attach = devcgroup_can_attach,
|
||||||
.create = devcgroup_create,
|
.create = devcgroup_create,
|
||||||
.destroy = devcgroup_destroy,
|
.destroy = devcgroup_destroy,
|
||||||
.populate = devcgroup_populate,
|
.populate = devcgroup_populate,
|
||||||
.subsys_id = devices_subsys_id,
|
.subsys_id = devices_subsys_id,
|
||||||
};
|
};
|
||||||
|
|
|
@ -355,7 +355,7 @@ EXPORT_SYMBOL(key_alloc);
|
||||||
*/
|
*/
|
||||||
int key_payload_reserve(struct key *key, size_t datalen)
|
int key_payload_reserve(struct key *key, size_t datalen)
|
||||||
{
|
{
|
||||||
int delta = (int) datalen - key->datalen;
|
int delta = (int)datalen - key->datalen;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
key_check(key);
|
key_check(key);
|
||||||
|
|
|
@ -212,15 +212,15 @@ SYSCALL_DEFINE4(request_key, const char __user *, _type,
|
||||||
ret = key->serial;
|
ret = key->serial;
|
||||||
|
|
||||||
key_put(key);
|
key_put(key);
|
||||||
error5:
|
error5:
|
||||||
key_type_put(ktype);
|
key_type_put(ktype);
|
||||||
error4:
|
error4:
|
||||||
key_ref_put(dest_ref);
|
key_ref_put(dest_ref);
|
||||||
error3:
|
error3:
|
||||||
kfree(callout_info);
|
kfree(callout_info);
|
||||||
error2:
|
error2:
|
||||||
kfree(description);
|
kfree(description);
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end sys_request_key() */
|
} /* end sys_request_key() */
|
||||||
|
@ -246,7 +246,7 @@ long keyctl_get_keyring_ID(key_serial_t id, int create)
|
||||||
|
|
||||||
ret = key_ref_to_ptr(key_ref)->serial;
|
ret = key_ref_to_ptr(key_ref)->serial;
|
||||||
key_ref_put(key_ref);
|
key_ref_put(key_ref);
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyctl_get_keyring_ID() */
|
} /* end keyctl_get_keyring_ID() */
|
||||||
|
@ -275,7 +275,7 @@ long keyctl_join_session_keyring(const char __user *_name)
|
||||||
ret = join_session_keyring(name);
|
ret = join_session_keyring(name);
|
||||||
kfree(name);
|
kfree(name);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyctl_join_session_keyring() */
|
} /* end keyctl_join_session_keyring() */
|
||||||
|
@ -322,9 +322,9 @@ long keyctl_update_key(key_serial_t id,
|
||||||
ret = key_update(key_ref, payload, plen);
|
ret = key_update(key_ref, payload, plen);
|
||||||
|
|
||||||
key_ref_put(key_ref);
|
key_ref_put(key_ref);
|
||||||
error2:
|
error2:
|
||||||
kfree(payload);
|
kfree(payload);
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyctl_update_key() */
|
} /* end keyctl_update_key() */
|
||||||
|
@ -356,7 +356,7 @@ long keyctl_revoke_key(key_serial_t id)
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
key_ref_put(key_ref);
|
key_ref_put(key_ref);
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyctl_revoke_key() */
|
} /* end keyctl_revoke_key() */
|
||||||
|
@ -381,7 +381,7 @@ long keyctl_keyring_clear(key_serial_t ringid)
|
||||||
ret = keyring_clear(key_ref_to_ptr(keyring_ref));
|
ret = keyring_clear(key_ref_to_ptr(keyring_ref));
|
||||||
|
|
||||||
key_ref_put(keyring_ref);
|
key_ref_put(keyring_ref);
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyctl_keyring_clear() */
|
} /* end keyctl_keyring_clear() */
|
||||||
|
@ -413,9 +413,9 @@ long keyctl_keyring_link(key_serial_t id, key_serial_t ringid)
|
||||||
ret = key_link(key_ref_to_ptr(keyring_ref), key_ref_to_ptr(key_ref));
|
ret = key_link(key_ref_to_ptr(keyring_ref), key_ref_to_ptr(key_ref));
|
||||||
|
|
||||||
key_ref_put(key_ref);
|
key_ref_put(key_ref);
|
||||||
error2:
|
error2:
|
||||||
key_ref_put(keyring_ref);
|
key_ref_put(keyring_ref);
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyctl_keyring_link() */
|
} /* end keyctl_keyring_link() */
|
||||||
|
@ -447,9 +447,9 @@ long keyctl_keyring_unlink(key_serial_t id, key_serial_t ringid)
|
||||||
ret = key_unlink(key_ref_to_ptr(keyring_ref), key_ref_to_ptr(key_ref));
|
ret = key_unlink(key_ref_to_ptr(keyring_ref), key_ref_to_ptr(key_ref));
|
||||||
|
|
||||||
key_ref_put(key_ref);
|
key_ref_put(key_ref);
|
||||||
error2:
|
error2:
|
||||||
key_ref_put(keyring_ref);
|
key_ref_put(keyring_ref);
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyctl_keyring_unlink() */
|
} /* end keyctl_keyring_unlink() */
|
||||||
|
@ -529,9 +529,9 @@ long keyctl_describe_key(key_serial_t keyid,
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(tmpbuf);
|
kfree(tmpbuf);
|
||||||
error2:
|
error2:
|
||||||
key_ref_put(key_ref);
|
key_ref_put(key_ref);
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyctl_describe_key() */
|
} /* end keyctl_describe_key() */
|
||||||
|
@ -616,17 +616,17 @@ long keyctl_keyring_search(key_serial_t ringid,
|
||||||
|
|
||||||
ret = key_ref_to_ptr(key_ref)->serial;
|
ret = key_ref_to_ptr(key_ref)->serial;
|
||||||
|
|
||||||
error6:
|
error6:
|
||||||
key_ref_put(key_ref);
|
key_ref_put(key_ref);
|
||||||
error5:
|
error5:
|
||||||
key_type_put(ktype);
|
key_type_put(ktype);
|
||||||
error4:
|
error4:
|
||||||
key_ref_put(dest_ref);
|
key_ref_put(dest_ref);
|
||||||
error3:
|
error3:
|
||||||
key_ref_put(keyring_ref);
|
key_ref_put(keyring_ref);
|
||||||
error2:
|
error2:
|
||||||
kfree(description);
|
kfree(description);
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyctl_keyring_search() */
|
} /* end keyctl_keyring_search() */
|
||||||
|
@ -673,7 +673,7 @@ long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the key is probably readable - now try to read it */
|
/* the key is probably readable - now try to read it */
|
||||||
can_read_key:
|
can_read_key:
|
||||||
ret = key_validate(key);
|
ret = key_validate(key);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = -EOPNOTSUPP;
|
ret = -EOPNOTSUPP;
|
||||||
|
@ -686,9 +686,9 @@ long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error2:
|
error2:
|
||||||
key_put(key);
|
key_put(key);
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyctl_read_key() */
|
} /* end keyctl_read_key() */
|
||||||
|
@ -1282,16 +1282,16 @@ long keyctl_session_to_parent(void)
|
||||||
|
|
||||||
/* the parent must have the same effective ownership and mustn't be
|
/* the parent must have the same effective ownership and mustn't be
|
||||||
* SUID/SGID */
|
* SUID/SGID */
|
||||||
if (pcred-> uid != mycred->euid ||
|
if (pcred->uid != mycred->euid ||
|
||||||
pcred->euid != mycred->euid ||
|
pcred->euid != mycred->euid ||
|
||||||
pcred->suid != mycred->euid ||
|
pcred->suid != mycred->euid ||
|
||||||
pcred-> gid != mycred->egid ||
|
pcred->gid != mycred->egid ||
|
||||||
pcred->egid != mycred->egid ||
|
pcred->egid != mycred->egid ||
|
||||||
pcred->sgid != mycred->egid)
|
pcred->sgid != mycred->egid)
|
||||||
goto not_permitted;
|
goto not_permitted;
|
||||||
|
|
||||||
/* the keyrings must have the same UID */
|
/* the keyrings must have the same UID */
|
||||||
if (pcred ->tgcred->session_keyring->uid != mycred->euid ||
|
if (pcred->tgcred->session_keyring->uid != mycred->euid ||
|
||||||
mycred->tgcred->session_keyring->uid != mycred->euid)
|
mycred->tgcred->session_keyring->uid != mycred->euid)
|
||||||
goto not_permitted;
|
goto not_permitted;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ static inline unsigned keyring_hash(const char *desc)
|
||||||
unsigned bucket = 0;
|
unsigned bucket = 0;
|
||||||
|
|
||||||
for (; *desc; desc++)
|
for (; *desc; desc++)
|
||||||
bucket += (unsigned char) *desc;
|
bucket += (unsigned char)*desc;
|
||||||
|
|
||||||
return bucket & (KEYRING_NAME_HASH_SIZE - 1);
|
return bucket & (KEYRING_NAME_HASH_SIZE - 1);
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ static long keyring_read(const struct key *keyring,
|
||||||
ret = qty;
|
ret = qty;
|
||||||
}
|
}
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end keyring_read() */
|
} /* end keyring_read() */
|
||||||
|
@ -506,7 +506,7 @@ key_ref_t __keyring_search_one(key_ref_t keyring_ref,
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
return ERR_PTR(-ENOKEY);
|
return ERR_PTR(-ENOKEY);
|
||||||
|
|
||||||
found:
|
found:
|
||||||
atomic_inc(&key->usage);
|
atomic_inc(&key->usage);
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
return make_key_ref(key, possessed);
|
return make_key_ref(key, possessed);
|
||||||
|
@ -563,7 +563,7 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check)
|
||||||
read_unlock(&keyring_name_lock);
|
read_unlock(&keyring_name_lock);
|
||||||
keyring = ERR_PTR(-ENOKEY);
|
keyring = ERR_PTR(-ENOKEY);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return keyring;
|
return keyring;
|
||||||
|
|
||||||
} /* end find_keyring_by_name() */
|
} /* end find_keyring_by_name() */
|
||||||
|
@ -596,7 +596,7 @@ static int keyring_detect_cycle(struct key *A, struct key *B)
|
||||||
sp = 0;
|
sp = 0;
|
||||||
|
|
||||||
/* start processing a new keyring */
|
/* start processing a new keyring */
|
||||||
descend:
|
descend:
|
||||||
if (test_bit(KEY_FLAG_REVOKED, &subtree->flags))
|
if (test_bit(KEY_FLAG_REVOKED, &subtree->flags))
|
||||||
goto not_this_keyring;
|
goto not_this_keyring;
|
||||||
|
|
||||||
|
@ -605,7 +605,7 @@ static int keyring_detect_cycle(struct key *A, struct key *B)
|
||||||
goto not_this_keyring;
|
goto not_this_keyring;
|
||||||
kix = 0;
|
kix = 0;
|
||||||
|
|
||||||
ascend:
|
ascend:
|
||||||
/* iterate through the remaining keys in this keyring */
|
/* iterate through the remaining keys in this keyring */
|
||||||
for (; kix < keylist->nkeys; kix++) {
|
for (; kix < keylist->nkeys; kix++) {
|
||||||
key = keylist->keys[kix];
|
key = keylist->keys[kix];
|
||||||
|
@ -631,7 +631,7 @@ static int keyring_detect_cycle(struct key *A, struct key *B)
|
||||||
|
|
||||||
/* the keyring we're looking at was disqualified or didn't contain a
|
/* the keyring we're looking at was disqualified or didn't contain a
|
||||||
* matching key */
|
* matching key */
|
||||||
not_this_keyring:
|
not_this_keyring:
|
||||||
if (sp > 0) {
|
if (sp > 0) {
|
||||||
/* resume the checking of a keyring higher up in the tree */
|
/* resume the checking of a keyring higher up in the tree */
|
||||||
sp--;
|
sp--;
|
||||||
|
@ -642,15 +642,15 @@ static int keyring_detect_cycle(struct key *A, struct key *B)
|
||||||
|
|
||||||
ret = 0; /* no cycles detected */
|
ret = 0; /* no cycles detected */
|
||||||
|
|
||||||
error:
|
error:
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
too_deep:
|
too_deep:
|
||||||
ret = -ELOOP;
|
ret = -ELOOP;
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
cycle_detected:
|
cycle_detected:
|
||||||
ret = -EDEADLK;
|
ret = -EDEADLK;
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ int key_validate(struct key *key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
} /* end key_validate() */
|
} /* end key_validate() */
|
||||||
|
|
|
@ -307,7 +307,7 @@ static void *proc_key_users_start(struct seq_file *p, loff_t *_pos)
|
||||||
static void *proc_key_users_next(struct seq_file *p, void *v, loff_t *_pos)
|
static void *proc_key_users_next(struct seq_file *p, void *v, loff_t *_pos)
|
||||||
{
|
{
|
||||||
(*_pos)++;
|
(*_pos)++;
|
||||||
return key_user_next((struct rb_node *) v);
|
return key_user_next((struct rb_node *)v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void proc_key_users_stop(struct seq_file *p, void *v)
|
static void proc_key_users_stop(struct seq_file *p, void *v)
|
||||||
|
|
Loading…
Reference in New Issue