| /security/selinux/ss/ |
| A D | policydb.c | 1007 __le32 buf[2]; in mls_read_range_helper() local 1067 __le32 buf[3]; in context_read_and_validate() local 1070 rc = next_entry(buf, fp, sizeof buf); in context_read_and_validate() 1138 rc = next_entry(buf, fp, sizeof buf); in perm_read() 1171 rc = next_entry(buf, fp, sizeof buf); in common_read() 1437 rc = next_entry(buf, fp, sizeof(buf[0]) * to_read); in role_read() 1494 rc = next_entry(buf, fp, sizeof(buf[0]) * to_read); in type_read() 1537 rc = next_entry(buf, fp, sizeof buf); in mls_read_level() 1568 rc = next_entry(buf, fp, sizeof(buf[0]) * to_read); in user_read() 1615 rc = next_entry(buf, fp, sizeof buf); in sens_read() [all …]
|
| A D | conditional.c | 213 __le32 buf[3]; in cond_read_bool() local 221 rc = next_entry(buf, fp, sizeof(buf)); in cond_read_bool() 232 len = le32_to_cpu(buf[2]); in cond_read_bool() 325 __le32 buf[1]; in cond_read_av_list() local 374 __le32 buf[2]; in cond_read_node() local 414 __le32 buf[1]; in cond_read_list() local 418 rc = next_entry(buf, fp, sizeof(buf)); in cond_read_list() 451 __le32 buf[3]; in cond_write_bool() local 480 __le32 buf[1]; in cond_write_av_list() local 501 __le32 buf[2]; in cond_write_node() local [all …]
|
| A D | ebitmap.c | 370 __le32 buf[3]; in ebitmap_read() local 375 rc = next_entry(buf, fp, sizeof buf); in ebitmap_read() 379 mapunit = le32_to_cpu(buf[0]); in ebitmap_read() 380 e->highbit = le32_to_cpu(buf[1]); in ebitmap_read() 381 count = le32_to_cpu(buf[2]); in ebitmap_read() 485 __le32 buf[3]; in ebitmap_write() local 489 buf[0] = cpu_to_le32(BITS_PER_U64); in ebitmap_write() 503 buf[1] = cpu_to_le32(last_bit); in ebitmap_write() 504 buf[2] = cpu_to_le32(count); in ebitmap_write() 526 buf[0] = cpu_to_le32(last_startbit); in ebitmap_write() [all …]
|
| /security/keys/trusted-keys/ |
| A D | trusted_tpm2.c | 111 u8 **buf) in tpm2_key_decode() argument 131 *buf = blob; in tpm2_key_decode() 245 struct tpm_buf buf, sized; in tpm2_seal_trusted() local 281 tpm_buf_destroy(&buf); in tpm2_seal_trusted() 323 tpm_buf_append_u16(&buf, 0); in tpm2_seal_trusted() 326 tpm_buf_append_u32(&buf, 0); in tpm2_seal_trusted() 354 tpm_buf_destroy(&buf); in tpm2_seal_trusted() 390 struct tpm_buf buf; in tpm2_load_cmd() local 469 tpm_buf_destroy(&buf); in tpm2_load_cmd() 494 struct tpm_buf buf; in tpm2_unseal_cmd() local [all …]
|
| A D | trusted_dcp.c | 301 void *buf = NULL; in test_for_zero_key() local 307 buf = kmalloc(AES_BLOCK_SIZE, GFP_KERNEL); in test_for_zero_key() 308 if (!buf) { in test_for_zero_key() 313 memset(buf, 0x55, AES_BLOCK_SIZE); in test_for_zero_key() 315 ret = do_dcp_crypto(buf, buf, true); in test_for_zero_key() 319 if (memcmp(buf, bad, AES_BLOCK_SIZE) == 0) { in test_for_zero_key() 324 kfree(buf); in test_for_zero_key()
|
| /security/apparmor/ |
| A D | path.c | 65 error = prepend(name, *name - buf, "/", 1); in disconnect() 67 error = prepend(name, *name - buf, disconnected, in disconnect() 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() 136 *name = buf; in d_namespace_path() 143 *name = buf; in d_namespace_path() [all …]
|
| A D | policy_unpack_test.c | 59 char *buf; in build_aa_ext_struct() local 68 e->start = buf; in build_aa_ext_struct() 72 *buf = AA_NAME; in build_aa_ext_struct() 74 strscpy(buf + 3, TEST_STRING_NAME, e->end - (void *)(buf + 3)); in build_aa_ext_struct() 79 strscpy(buf + 3, TEST_STRING_DATA, e->end - (void *)(buf + 3)); in build_aa_ext_struct() 81 *buf = AA_NAME; in build_aa_ext_struct() 83 strscpy(buf + 3, TEST_U32_NAME, e->end - (void *)(buf + 3)); in build_aa_ext_struct() 88 *buf = AA_NAME; in build_aa_ext_struct() 90 strscpy(buf + 3, TEST_U64_NAME, e->end - (void *)(buf + 3)); in build_aa_ext_struct() 95 *buf = AA_NAME; in build_aa_ext_struct() [all …]
|
| /security/selinux/ |
| A D | ima.c | 24 char *buf; in selinux_ima_collect_state() local 33 buf = kzalloc(buf_len, GFP_KERNEL); in selinux_ima_collect_state() 34 if (!buf) in selinux_ima_collect_state() 37 rc = strscpy(buf, "initialized", buf_len); in selinux_ima_collect_state() 43 rc = strlcat(buf, "enforcing", buf_len); in selinux_ima_collect_state() 46 rc = strlcat(buf, enforcing_enabled() ? on : off, buf_len); in selinux_ima_collect_state() 49 rc = strlcat(buf, "checkreqprot", buf_len); in selinux_ima_collect_state() 52 rc = strlcat(buf, checkreqprot_get() ? on : off, buf_len); in selinux_ima_collect_state() 56 rc = strlcat(buf, selinux_policycap_names[i], buf_len); in selinux_ima_collect_state() 59 rc = strlcat(buf, selinux_state.policycap[i] ? on : off, in selinux_ima_collect_state() [all …]
|
| A D | selinuxfs.c | 151 page = memdup_user_nul(buf, count); in sel_write_enforce() 286 page = memdup_user_nul(buf, count); in sel_write_disable() 660 memcpy(buf, canon, len); in sel_write_context() 729 const char __user *buf, in sel_write_validatetrans() argument 752 req = memdup_user_nul(buf, count); in sel_write_validatetrans() 995 memcpy(buf, newcon, len); in sel_write_create() 1054 memcpy(buf, newcon, len); in sel_write_relabel() 1106 ptr = buf + length; in sel_write_user() 1182 memcpy(buf, newcon, len); in sel_write_member() 1300 const char __user *buf, in sel_commit_bools_write() argument [all …]
|
| /security/keys/ |
| A D | big_key.c | 61 u8 *buf, *enckey; in big_key_preparse() local 87 buf = kvmalloc(enclen, GFP_KERNEL); in big_key_preparse() 88 if (!buf) in big_key_preparse() 127 kvfree_sensitive(buf, enclen); in big_key_preparse() 145 kvfree_sensitive(buf, enclen); in big_key_preparse() 238 u8 *buf, *enckey = payload->data; in big_key_read() local 242 buf = kvmalloc(enclen, GFP_KERNEL); in big_key_read() 243 if (!buf) in big_key_read() 260 ret = chacha20poly1305_decrypt(buf, buf, enclen, NULL, 0, 0, in big_key_read() 268 memcpy(buffer, buf, datalen); in big_key_read() [all …]
|
| A 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/ |
| A D | securityfs.c | 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 156 p = buf = memdup_user_nul(ubuf, len); in handle_policy_update() 157 if (IS_ERR(buf)) { in handle_policy_update() 158 err = PTR_ERR(buf); in handle_policy_update() 161 pol->policy_str = kstrdup(buf, GFP_KERNEL); in handle_policy_update() 231 kfree(buf); in handle_policy_update() 239 const char __user *buf, in safesetid_uid_file_write() argument 253 const char __user *buf, in safesetid_gid_file_write() argument [all …]
|
| /security/tomoyo/ |
| A D | realpath.c | 239 char *buf = NULL; in tomoyo_realpath_from_path() local 250 kfree(buf); in tomoyo_realpath_from_path() 251 buf = kmalloc(buf_len, GFP_NOFS); in tomoyo_realpath_from_path() 252 if (!buf) in tomoyo_realpath_from_path() 255 buf[buf_len - 1] = '\0'; in tomoyo_realpath_from_path() 258 pos = dentry->d_op->d_dname(dentry, buf, buf_len - 1); in tomoyo_realpath_from_path() 267 pos = tomoyo_get_local_path(path->dentry, buf, in tomoyo_realpath_from_path() 277 pos = tomoyo_get_local_path(path->dentry, buf, in tomoyo_realpath_from_path() 286 kfree(buf); in tomoyo_realpath_from_path() 304 char *buf = tomoyo_realpath_from_path(&path); in tomoyo_realpath_nofollow() local [all …]
|
| A 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() 295 return buf; in tomoyo_init_log() 369 char *buf; in tomoyo_write_log2() local 377 if (!buf) in tomoyo_write_log2() 381 kfree(buf); in tomoyo_write_log2() 384 entry->log = buf; in tomoyo_write_log2() [all …]
|
| A D | file.c | 132 if (buf->is_dir) in tomoyo_add_slash() 152 if (buf->name) { in tomoyo_get_realpath() 727 tomoyo_add_slash(&buf); in tomoyo_path_number_perm() 736 kfree(buf.name); in tomoyo_path_number_perm() 765 buf.name = NULL; in tomoyo_check_open_permission() 778 &buf); in tomoyo_check_open_permission() 783 &buf); in tomoyo_check_open_permission() 786 kfree(buf.name); in tomoyo_check_open_permission() 820 buf.name = NULL; in tomoyo_path_perm() 842 kfree(buf.name); in tomoyo_path_perm() [all …]
|
| A D | network.c | 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() 557 buf = "anonymous"; in tomoyo_unix_entry() 559 } else if (buf[0]) { in tomoyo_unix_entry() 562 buf = tomoyo_encode2(buf, len); in tomoyo_unix_entry() 563 if (buf) { in tomoyo_unix_entry() 566 addr.name = buf; in tomoyo_unix_entry() [all …]
|
| A 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/ |
| A D | ima_kexec.c | 29 vfree(sf->buf); in ima_free_kexec_file_buf() 30 sf->buf = NULL; in ima_free_kexec_file_buf() 61 if (ima_kexec_file.buf && ima_kexec_file.size == segment_size) in ima_alloc_kexec_file_buf() 67 ima_kexec_file.buf = vmalloc(segment_size); in ima_alloc_kexec_file_buf() 68 if (!ima_kexec_file.buf) in ima_alloc_kexec_file_buf() 89 if (!ima_kexec_file.buf) { in ima_dump_measurement_list() 117 memcpy(ima_kexec_file.buf, &khdr, sizeof(khdr)); in ima_dump_measurement_list() 120 ima_kexec_file.buf, ima_kexec_file.count < 100 ? in ima_dump_measurement_list() 125 *buffer = ima_kexec_file.buf; in ima_dump_measurement_list() 208 void *buf = NULL; in ima_update_kexec_buffer() local [all …]
|
| A D | ima_main.c | 395 rc = ima_read_modsig(func, buf, size, &modsig); in process_measurement() 683 if (buf) { in __ima_inode_hash() 687 memcpy(buf, iint->ima_hash->digest, copied_size); in __ima_inode_hash() 747 return __ima_inode_hash(inode, NULL, buf, buf_size); in ima_inode_hash() 966 static int ima_post_load_data(char *buf, loff_t size, in ima_post_load_data() argument 984 buf, size, true, NULL, 0); in ima_post_load_data() 1021 .buf = buf, in process_buffer_measurement() 1085 event_data.buf = digest_hash; in process_buffer_measurement() 1126 if (!buf || !size) in ima_kexec_cmdline() 1134 buf, size, "kexec-cmdline", KEXEC_CMDLINE, 0, in ima_kexec_cmdline() [all …]
|
| A 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() 73 hdr->pkcs7_msg = pkcs7_parse_message(buf + buf_len, sig_len); in ima_read_modsig() 80 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()
|
| A D | ima.h | 78 const void *buf; member 266 int ima_calc_buffer_hash(const void *buf, loff_t len, 285 int ima_restore_measurement_list(loff_t bufsize, void *buf); 389 void *buf, loff_t size, enum hash_algo algo, 397 struct inode *inode, const void *buf, int size, 512 int ima_read_modsig(enum ima_hooks func, const void *buf, loff_t buf_len, 514 void ima_collect_modsig(struct modsig *modsig, const void *buf, loff_t size); 521 static inline int ima_read_modsig(enum ima_hooks func, const void *buf, in ima_read_modsig() argument 527 static inline void ima_collect_modsig(struct modsig *modsig, const void *buf, in ima_collect_modsig() argument
|
| /security/integrity/platform_certs/ |
| A D | load_powerpc.c | 68 char buf[32]; in load_powerpc_certs() local 73 len = secvar_ops->format(buf, sizeof(buf)); in load_powerpc_certs() 78 if (strcmp("ibm,edk2-compat-v1", buf) && strcmp("ibm,plpks-sb-v1", buf) && in load_powerpc_certs() 79 strcmp("ibm,plpks-sb-v0", buf)) { in load_powerpc_certs() 80 pr_err("Unsupported secvar implementation \"%s\", not loading certs\n", buf); in load_powerpc_certs() 84 if (strcmp("ibm,plpks-sb-v1", buf) == 0 || strcmp("ibm,plpks-sb-v0", buf) == 0) in load_powerpc_certs()
|
| /security/smack/ |
| A D | smackfs.c | 476 data = memdup_user_nul(buf, count); in smk_write_rules_list() 845 data = memdup_user_nul(buf, count); in smk_set_cipso() 1164 data = memdup_user_nul(buf, count); in smk_write_net4addr() 1422 data = memdup_user_nul(buf, count); in smk_write_net6addr() 1592 if (copy_from_user(temp, buf, count) != 0) in smk_write_doi() 1830 data = memdup_user_nul(buf, count); in smk_write_ambient() 2004 data = memdup_user_nul(buf, count); in smk_write_onlycap() 2094 data = memdup_user_nul(buf, count); in smk_write_unconfined() 2525 data = memdup_user(buf, count); in smk_write_revoke_subj() 2656 data = memdup_user_nul(buf, count); in smk_write_syslog() [all …]
|
| /security/integrity/evm/ |
| A D | evm_secfs.c | 38 static ssize_t evm_read_key(struct file *filp, char __user *buf, in evm_read_key() argument 48 rc = simple_read_from_buffer(buf, count, ppos, temp, strlen(temp)); in evm_read_key() 65 static ssize_t evm_write_key(struct file *file, const char __user *buf, in evm_write_key() argument 74 ret = kstrtouint_from_user(buf, count, 0, &i); in evm_write_key() 126 static ssize_t evm_read_xattrs(struct file *filp, char __user *buf, in evm_read_xattrs() argument 163 rc = simple_read_from_buffer(buf, count, ppos, temp, strlen(temp)); in evm_read_xattrs() 179 static ssize_t evm_write_xattrs(struct file *file, const char __user *buf, in evm_write_xattrs() argument 209 xattr->name = memdup_user_nul(buf, count); in evm_write_xattrs()
|
| /security/lockdown/ |
| A D | lockdown.c | 96 static ssize_t lockdown_read(struct file *filp, char __user *buf, size_t count, in lockdown_read() argument 119 return simple_read_from_buffer(buf, count, ppos, temp, strlen(temp)); in lockdown_read() 122 static ssize_t lockdown_write(struct file *file, const char __user *buf, in lockdown_write() argument 128 state = memdup_user_nul(buf, n); in lockdown_write()
|