/security/keys/trusted-keys/ |
D | trusted_tpm2.c | 98 u8 **buf) in tpm2_key_decode() argument 118 *buf = blob; in tpm2_key_decode() 199 static void tpm2_buf_append_auth(struct tpm_buf *buf, u32 session_handle, in tpm2_buf_append_auth() argument 204 tpm_buf_append_u32(buf, 9 + nonce_len + hmac_len); in tpm2_buf_append_auth() 205 tpm_buf_append_u32(buf, session_handle); in tpm2_buf_append_auth() 206 tpm_buf_append_u16(buf, nonce_len); in tpm2_buf_append_auth() 209 tpm_buf_append(buf, nonce, nonce_len); in tpm2_buf_append_auth() 211 tpm_buf_append_u8(buf, attributes); in tpm2_buf_append_auth() 212 tpm_buf_append_u16(buf, hmac_len); in tpm2_buf_append_auth() 215 tpm_buf_append(buf, hmac, hmac_len); in tpm2_buf_append_auth() [all …]
|
/security/selinux/ss/ |
D | policydb.c | 978 __le32 buf[2]; in mls_read_range_helper() local 982 rc = next_entry(buf, fp, sizeof(u32)); in mls_read_range_helper() 987 items = le32_to_cpu(buf[0]); in mls_read_range_helper() 988 if (items > ARRAY_SIZE(buf)) { in mls_read_range_helper() 993 rc = next_entry(buf, fp, sizeof(u32) * items); in mls_read_range_helper() 999 r->level[0].sens = le32_to_cpu(buf[0]); in mls_read_range_helper() 1001 r->level[1].sens = le32_to_cpu(buf[1]); in mls_read_range_helper() 1039 __le32 buf[3]; in context_read_and_validate() local 1042 rc = next_entry(buf, fp, sizeof buf); in context_read_and_validate() 1047 c->user = le32_to_cpu(buf[0]); in context_read_and_validate() [all …]
|
D | conditional.c | 212 __le32 buf[3]; in cond_read_bool() local 220 rc = next_entry(buf, fp, sizeof(buf)); in cond_read_bool() 224 booldatum->value = le32_to_cpu(buf[0]); in cond_read_bool() 225 booldatum->state = le32_to_cpu(buf[1]); in cond_read_bool() 231 len = le32_to_cpu(buf[2]); in cond_read_bool() 329 __le32 buf[1]; in cond_read_av_list() local 333 rc = next_entry(buf, fp, sizeof(u32)); in cond_read_av_list() 337 len = le32_to_cpu(buf[0]); in cond_read_av_list() 378 __le32 buf[2]; in cond_read_node() local 382 rc = next_entry(buf, fp, sizeof(u32) * 2); in cond_read_node() [all …]
|
D | ebitmap.c | 372 __le32 buf[3]; in ebitmap_read() local 377 rc = next_entry(buf, fp, sizeof buf); in ebitmap_read() 381 mapunit = le32_to_cpu(buf[0]); in ebitmap_read() 382 e->highbit = le32_to_cpu(buf[1]); in ebitmap_read() 383 count = le32_to_cpu(buf[2]); in ebitmap_read() 475 __le32 buf[3]; in ebitmap_write() local 479 buf[0] = cpu_to_le32(BITS_PER_U64); in ebitmap_write() 491 buf[1] = cpu_to_le32(last_bit); in ebitmap_write() 492 buf[2] = cpu_to_le32(count); in ebitmap_write() 494 rc = put_entry(buf, sizeof(u32), 3, fp); in ebitmap_write() [all …]
|
/security/apparmor/ |
D | path.c | 48 static int disconnect(const struct path *path, char *buf, char **name, in disconnect() argument 65 error = prepend(name, *name - buf, "/", 1); in disconnect() 67 error = prepend(name, *name - buf, disconnected, in disconnect() 88 static int d_namespace_path(const struct path *path, char *buf, char **name, in d_namespace_path() argument 99 res = dentry_path(path->dentry, buf, buflen); in d_namespace_path() 102 *name = buf; in d_namespace_path() 110 error = prepend(name, *name - buf, "/proc", 5); in d_namespace_path() 113 error = disconnect(path, buf, name, flags, in d_namespace_path() 122 res = __d_path(path, &root, buf, buflen); in d_namespace_path() 125 res = d_absolute_path(path, buf, buflen); in d_namespace_path() [all …]
|
D | policy_unpack_test.c | 54 char *buf; in build_aa_ext_struct() local 57 buf = kunit_kzalloc(test, buf_size, GFP_USER); in build_aa_ext_struct() 58 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, buf); in build_aa_ext_struct() 63 e->start = buf; in build_aa_ext_struct() 67 *buf = AA_NAME; in build_aa_ext_struct() 68 *(buf + 1) = strlen(TEST_STRING_NAME) + 1; in build_aa_ext_struct() 69 strcpy(buf + 3, TEST_STRING_NAME); in build_aa_ext_struct() 71 buf = e->start + TEST_STRING_BUF_OFFSET; in build_aa_ext_struct() 72 *buf = AA_STRING; in build_aa_ext_struct() 73 *(buf + 1) = strlen(TEST_STRING_DATA) + 1; in build_aa_ext_struct() [all …]
|
/security/selinux/ |
D | ima.c | 26 char *buf; in selinux_ima_collect_state() local 35 buf = kzalloc(buf_len, GFP_KERNEL); in selinux_ima_collect_state() 36 if (!buf) in selinux_ima_collect_state() 39 rc = strscpy(buf, "initialized", buf_len); in selinux_ima_collect_state() 42 rc = strlcat(buf, selinux_initialized(state) ? on : off, buf_len); in selinux_ima_collect_state() 45 rc = strlcat(buf, "enforcing", buf_len); in selinux_ima_collect_state() 48 rc = strlcat(buf, enforcing_enabled(state) ? on : off, buf_len); in selinux_ima_collect_state() 51 rc = strlcat(buf, "checkreqprot", buf_len); in selinux_ima_collect_state() 54 rc = strlcat(buf, checkreqprot_get(state) ? on : off, buf_len); in selinux_ima_collect_state() 58 rc = strlcat(buf, selinux_policycap_names[i], buf_len); in selinux_ima_collect_state() [all …]
|
D | selinuxfs.c | 125 static ssize_t sel_read_enforce(struct file *filp, char __user *buf, in sel_read_enforce() argument 134 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); in sel_read_enforce() 138 static ssize_t sel_write_enforce(struct file *file, const char __user *buf, in sel_write_enforce() argument 155 page = memdup_user_nul(buf, count); in sel_write_enforce() 204 static ssize_t sel_read_handle_unknown(struct file *filp, char __user *buf, in sel_read_handle_unknown() argument 217 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); in sel_read_handle_unknown() 238 static ssize_t sel_read_handle_status(struct file *filp, char __user *buf, in sel_read_handle_status() argument 245 return simple_read_from_buffer(buf, count, ppos, in sel_read_handle_status() 280 static ssize_t sel_write_disable(struct file *file, const char __user *buf, in sel_write_disable() argument 304 page = memdup_user_nul(buf, count); in sel_write_disable() [all …]
|
/security/keys/ |
D | big_key.c | 60 u8 *buf, *enckey; in big_key_preparse() local 84 buf = kvmalloc(enclen, GFP_KERNEL); in big_key_preparse() 85 if (!buf) in big_key_preparse() 99 chacha20poly1305_encrypt(buf, prep->data, datalen, NULL, 0, in big_key_preparse() 109 written = kernel_write(file, buf, enclen, &pos); in big_key_preparse() 124 kvfree_sensitive(buf, enclen); in big_key_preparse() 142 kvfree_sensitive(buf, enclen); in big_key_preparse() 239 u8 *buf, *enckey = (u8 *)key->payload.data[big_key_data]; in big_key_read() local 243 buf = kvmalloc(enclen, GFP_KERNEL); in big_key_read() 244 if (!buf) in big_key_read() [all …]
|
D | process_keys.c | 83 char buf[20]; in look_up_user_keyrings() local 101 snprintf(buf, sizeof(buf), "_uid.%u", uid); in look_up_user_keyrings() 103 &key_type_keyring, buf, false); in look_up_user_keyrings() 106 uid_keyring = keyring_alloc(buf, cred->user->uid, INVALID_GID, in look_up_user_keyrings() 123 snprintf(buf, sizeof(buf), "_uid_ses.%u", uid); in look_up_user_keyrings() 125 &key_type_keyring, buf, false); in look_up_user_keyrings() 128 session_keyring = keyring_alloc(buf, cred->user->uid, INVALID_GID, in look_up_user_keyrings() 189 char buf[20]; in get_user_session_keyring_rcu() local 193 .index_key.description = buf, in get_user_session_keyring_rcu() 196 .match_data.raw_data = buf, in get_user_session_keyring_rcu() [all …]
|
/security/safesetid/ |
D | securityfs.c | 31 static int parse_policy_line(struct file *file, char *buf, in parse_policy_line() argument 39 child_str = strchr(buf, ':'); in parse_policy_line() 45 ret = kstrtou32(buf, 0, &parsed_parent); in parse_policy_line() 143 char *buf, *p, *end; in handle_policy_update() local 153 p = buf = memdup_user_nul(ubuf, len); in handle_policy_update() 154 if (IS_ERR(buf)) { in handle_policy_update() 155 err = PTR_ERR(buf); in handle_policy_update() 158 pol->policy_str = kstrdup(buf, GFP_KERNEL); in handle_policy_update() 228 kfree(buf); in handle_policy_update() 236 const char __user *buf, in safesetid_uid_file_write() argument [all …]
|
/security/tomoyo/ |
D | realpath.c | 239 char *buf = NULL; in tomoyo_realpath_from_path() local 253 kfree(buf); in tomoyo_realpath_from_path() 254 buf = kmalloc(buf_len, GFP_NOFS); in tomoyo_realpath_from_path() 255 if (!buf) in tomoyo_realpath_from_path() 258 buf[buf_len - 1] = '\0'; in tomoyo_realpath_from_path() 261 pos = dentry->d_op->d_dname(dentry, buf, buf_len - 1); in tomoyo_realpath_from_path() 272 pos = tomoyo_get_local_path(path->dentry, buf, in tomoyo_realpath_from_path() 276 pos = tomoyo_get_absolute_path(path, buf, buf_len - 1); in tomoyo_realpath_from_path() 282 pos = tomoyo_get_local_path(path->dentry, buf, in tomoyo_realpath_from_path() 291 kfree(buf); in tomoyo_realpath_from_path() [all …]
|
D | audit.c | 247 char *buf = NULL; in tomoyo_init_log() local 275 buf = kzalloc(len, GFP_NOFS); in tomoyo_init_log() 276 if (!buf) in tomoyo_init_log() 279 pos = snprintf(buf, len, "%s", header); in tomoyo_init_log() 283 pos += snprintf(buf + pos, len - pos, in tomoyo_init_log() 287 pos += snprintf(buf + pos, len - pos, " symlink.target=\"%s\"", in tomoyo_init_log() 289 pos += snprintf(buf + pos, len - pos, "\n%s\n", domainname); in tomoyo_init_log() 290 vsnprintf(buf + pos, len - pos, fmt, args); in tomoyo_init_log() 295 return buf; in tomoyo_init_log() 369 char *buf; in tomoyo_write_log2() local [all …]
|
D | file.c | 130 static void tomoyo_add_slash(struct tomoyo_path_info *buf) in tomoyo_add_slash() argument 132 if (buf->is_dir) in tomoyo_add_slash() 137 strcat((char *) buf->name, "/"); in tomoyo_add_slash() 138 tomoyo_fill_path_info(buf); in tomoyo_add_slash() 149 static bool tomoyo_get_realpath(struct tomoyo_path_info *buf, const struct path *path) in tomoyo_get_realpath() argument 151 buf->name = tomoyo_realpath_from_path(path); in tomoyo_get_realpath() 152 if (buf->name) { in tomoyo_get_realpath() 153 tomoyo_fill_path_info(buf); in tomoyo_get_realpath() 716 struct tomoyo_path_info buf; in tomoyo_path_number_perm() local 723 if (!tomoyo_get_realpath(&buf, path)) in tomoyo_path_number_perm() [all …]
|
D | network.c | 124 void tomoyo_print_ip(char *buf, const unsigned int size, in tomoyo_print_ip() argument 128 tomoyo_print_ipv6(buf, size, &ptr->ip[0], &ptr->ip[1]); in tomoyo_print_ip() 130 tomoyo_print_ipv4(buf, size, &ptr->ip[0].s6_addr32[0], in tomoyo_print_ip() 381 char buf[128]; in tomoyo_audit_inet_log() local 386 tomoyo_print_ipv6(buf, sizeof(buf), (const struct in6_addr *) in tomoyo_audit_inet_log() 389 tomoyo_print_ipv4(buf, sizeof(buf), address, address); in tomoyo_audit_inet_log() 390 len = strlen(buf); in tomoyo_audit_inet_log() 391 snprintf(buf + len, sizeof(buf) - len, " %u", in tomoyo_audit_inet_log() 394 r->param.inet_network.operation, buf); in tomoyo_audit_inet_log() 553 char *buf = address->unix0.addr; in tomoyo_unix_entry() local [all …]
|
D | securityfs_if.c | 41 static ssize_t tomoyo_write_self(struct file *file, const char __user *buf, in tomoyo_write_self() argument 49 data = memdup_user_nul(buf, count); in tomoyo_write_self() 100 static ssize_t tomoyo_read_self(struct file *file, char __user *buf, in tomoyo_read_self() argument 112 if (copy_to_user(buf, domain + pos, len)) in tomoyo_read_self() 176 static ssize_t tomoyo_read(struct file *file, char __user *buf, size_t count, in tomoyo_read() argument 179 return tomoyo_read_control(file->private_data, buf, count); in tomoyo_read() 192 static ssize_t tomoyo_write(struct file *file, const char __user *buf, in tomoyo_write() argument 195 return tomoyo_write_control(file->private_data, buf, count); in tomoyo_write()
|
/security/integrity/ima/ |
D | ima_main.c | 203 u32 secid, char *buf, loff_t size, int mask, in process_measurement() argument 341 rc = ima_read_modsig(func, buf, size, &modsig); in process_measurement() 351 rc = ima_collect_measurement(iint, file, buf, size, hash_algo, modsig); in process_measurement() 539 static int __ima_inode_hash(struct inode *inode, char *buf, size_t buf_size) in __ima_inode_hash() argument 562 if (buf) { in __ima_inode_hash() 566 memcpy(buf, iint->ima_hash->digest, copied_size); in __ima_inode_hash() 592 int ima_file_hash(struct file *file, char *buf, size_t buf_size) in ima_file_hash() argument 597 return __ima_inode_hash(file_inode(file), buf, buf_size); in ima_file_hash() 619 int ima_inode_hash(struct inode *inode, char *buf, size_t buf_size) in ima_inode_hash() argument 624 return __ima_inode_hash(inode, buf, buf_size); in ima_inode_hash() [all …]
|
D | ima_modsig.c | 40 int ima_read_modsig(enum ima_hooks func, const void *buf, loff_t buf_len, in ima_read_modsig() argument 53 p = buf + buf_len - marker_len; in ima_read_modsig() 72 hdr->pkcs7_msg = pkcs7_parse_message(buf + buf_len, sig_len); in ima_read_modsig() 79 memcpy(hdr->raw_pkcs7, buf + buf_len, sig_len); in ima_read_modsig() 100 void ima_collect_modsig(struct modsig *modsig, const void *buf, loff_t size) in ima_collect_modsig() argument 110 rc = pkcs7_supply_detached_data(modsig->pkcs7_msg, buf, size); in ima_collect_modsig()
|
D | ima_kexec.c | 27 file.buf = vmalloc(segment_size); in ima_dump_measurement_list() 28 if (!file.buf) { in ima_dump_measurement_list() 62 memcpy(file.buf, &khdr, sizeof(khdr)); in ima_dump_measurement_list() 65 16, 1, file.buf, in ima_dump_measurement_list() 69 *buffer = file.buf; in ima_dump_measurement_list() 72 vfree(file.buf); in ima_dump_measurement_list()
|
D | ima.h | 70 const void *buf; member 143 int ima_calc_buffer_hash(const void *buf, loff_t len, 162 int ima_restore_measurement_list(loff_t bufsize, void *buf); 264 struct file *file, void *buf, loff_t size, 272 struct inode *inode, const void *buf, int size, 383 int ima_read_modsig(enum ima_hooks func, const void *buf, loff_t buf_len, 385 void ima_collect_modsig(struct modsig *modsig, const void *buf, loff_t size); 392 static inline int ima_read_modsig(enum ima_hooks func, const void *buf, in ima_read_modsig() argument 398 static inline void ima_collect_modsig(struct modsig *modsig, const void *buf, in ima_collect_modsig() argument
|
D | ima_fs.c | 41 static ssize_t ima_show_htable_value(char __user *buf, size_t count, in ima_show_htable_value() argument 48 return simple_read_from_buffer(buf, count, ppos, tmpbuf, len); in ima_show_htable_value() 52 char __user *buf, in ima_show_htable_violations() argument 55 return ima_show_htable_value(buf, count, ppos, &ima_htable.violations); in ima_show_htable_violations() 64 char __user *buf, in ima_show_measurements_count() argument 67 return ima_show_htable_value(buf, count, ppos, &ima_htable.len); in ima_show_measurements_count() 314 static ssize_t ima_write_policy(struct file *file, const char __user *buf, in ima_write_policy() argument 328 data = memdup_user_nul(buf, datalen); in ima_write_policy()
|
D | ima_crypto.c | 663 static int calc_buffer_ahash_atfm(const void *buf, loff_t len, in calc_buffer_ahash_atfm() argument 687 sg_init_one(&sg, buf, len); in calc_buffer_ahash_atfm() 703 static int calc_buffer_ahash(const void *buf, loff_t len, in calc_buffer_ahash() argument 713 rc = calc_buffer_ahash_atfm(buf, len, hash, tfm); in calc_buffer_ahash() 720 static int calc_buffer_shash_tfm(const void *buf, loff_t size, in calc_buffer_shash_tfm() argument 738 rc = crypto_shash_update(shash, buf, len); in calc_buffer_shash_tfm() 741 buf += len; in calc_buffer_shash_tfm() 750 static int calc_buffer_shash(const void *buf, loff_t len, in calc_buffer_shash() argument 760 rc = calc_buffer_shash_tfm(buf, len, hash, tfm); in calc_buffer_shash() 766 int ima_calc_buffer_hash(const void *buf, loff_t len, in ima_calc_buffer_hash() argument [all …]
|
/security/smack/ |
D | smackfs.c | 443 static ssize_t smk_write_rules_list(struct file *file, const char __user *buf, in smk_write_rules_list() argument 475 data = memdup_user_nul(buf, count); in smk_write_rules_list() 657 static ssize_t smk_write_load(struct file *file, const char __user *buf, in smk_write_load() argument 668 return smk_write_rules_list(file, buf, count, ppos, NULL, NULL, in smk_write_load() 829 static ssize_t smk_set_cipso(struct file *file, const char __user *buf, in smk_set_cipso() argument 860 data = memdup_user_nul(buf, count); in smk_set_cipso() 950 static ssize_t smk_write_cipso(struct file *file, const char __user *buf, in smk_write_cipso() argument 953 return smk_set_cipso(file, buf, count, ppos, SMK_FIXED24_FMT); in smk_write_cipso() 1024 static ssize_t smk_write_cipso2(struct file *file, const char __user *buf, in smk_write_cipso2() argument 1027 return smk_set_cipso(file, buf, count, ppos, SMK_LONG_FMT); in smk_write_cipso2() [all …]
|
/security/integrity/evm/ |
D | evm_secfs.c | 39 static ssize_t evm_read_key(struct file *filp, char __user *buf, in evm_read_key() argument 49 rc = simple_read_from_buffer(buf, count, ppos, temp, strlen(temp)); in evm_read_key() 66 static ssize_t evm_write_key(struct file *file, const char __user *buf, in evm_write_key() argument 75 ret = kstrtouint_from_user(buf, count, 0, &i); in evm_write_key() 127 static ssize_t evm_read_xattrs(struct file *filp, char __user *buf, in evm_read_xattrs() argument 164 rc = simple_read_from_buffer(buf, count, ppos, temp, strlen(temp)); in evm_read_xattrs() 180 static ssize_t evm_write_xattrs(struct file *file, const char __user *buf, in evm_write_xattrs() argument 210 xattr->name = memdup_user_nul(buf, count); in evm_write_xattrs()
|
/security/lockdown/ |
D | lockdown.c | 90 static ssize_t lockdown_read(struct file *filp, char __user *buf, size_t count, in lockdown_read() argument 113 return simple_read_from_buffer(buf, count, ppos, temp, strlen(temp)); in lockdown_read() 116 static ssize_t lockdown_write(struct file *file, const char __user *buf, in lockdown_write() argument 122 state = memdup_user_nul(buf, n); in lockdown_write()
|