Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 38) sorted by relevance

12

/security/selinux/ss/
Dpolicydb.c967 __le32 buf[2]; in mls_read_range_helper() local
971 rc = next_entry(buf, fp, sizeof(u32)); in mls_read_range_helper()
976 items = le32_to_cpu(buf[0]); in mls_read_range_helper()
977 if (items > ARRAY_SIZE(buf)) { in mls_read_range_helper()
982 rc = next_entry(buf, fp, sizeof(u32) * items); in mls_read_range_helper()
988 r->level[0].sens = le32_to_cpu(buf[0]); in mls_read_range_helper()
990 r->level[1].sens = le32_to_cpu(buf[1]); in mls_read_range_helper()
1028 __le32 buf[3]; in context_read_and_validate() local
1031 rc = next_entry(buf, fp, sizeof buf); in context_read_and_validate()
1036 c->user = le32_to_cpu(buf[0]); in context_read_and_validate()
[all …]
Dconditional.c220 __le32 buf[3]; in cond_read_bool() local
228 rc = next_entry(buf, fp, sizeof buf); in cond_read_bool()
232 booldatum->value = le32_to_cpu(buf[0]); in cond_read_bool()
233 booldatum->state = le32_to_cpu(buf[1]); in cond_read_bool()
239 len = le32_to_cpu(buf[2]); in cond_read_bool()
352 __le32 buf[1]; in cond_read_av_list() local
358 rc = next_entry(buf, fp, sizeof(u32)); in cond_read_av_list()
362 len = le32_to_cpu(buf[0]); in cond_read_av_list()
397 __le32 buf[2]; in cond_read_node() local
402 rc = next_entry(buf, fp, sizeof(u32) * 2); in cond_read_node()
[all …]
Debitmap.c353 __le32 buf[3]; in ebitmap_read() local
358 rc = next_entry(buf, fp, sizeof buf); in ebitmap_read()
362 mapunit = le32_to_cpu(buf[0]); in ebitmap_read()
363 e->highbit = le32_to_cpu(buf[1]); in ebitmap_read()
364 count = le32_to_cpu(buf[2]); in ebitmap_read()
456 __le32 buf[3]; in ebitmap_write() local
460 buf[0] = cpu_to_le32(BITS_PER_U64); in ebitmap_write()
472 buf[1] = cpu_to_le32(last_bit); in ebitmap_write()
473 buf[2] = cpu_to_le32(count); in ebitmap_write()
475 rc = put_entry(buf, sizeof(u32), 3, fp); in ebitmap_write()
[all …]
/security/keys/
Dbig_key.c100 static int big_key_crypt(enum big_key_op op, struct big_key_buf *buf, size_t datalen, u8 *key) in big_key_crypt() argument
117 aead_request_set_crypt(aead_req, buf->sg, buf->sg, datalen, zero_nonce); in big_key_crypt()
139 static void big_key_free_buffer(struct big_key_buf *buf) in big_key_free_buffer() argument
143 if (buf->virt) { in big_key_free_buffer()
144 memset(buf->virt, 0, buf->nr_pages * PAGE_SIZE); in big_key_free_buffer()
145 vunmap(buf->virt); in big_key_free_buffer()
148 for (i = 0; i < buf->nr_pages; i++) in big_key_free_buffer()
149 if (buf->pages[i]) in big_key_free_buffer()
150 __free_page(buf->pages[i]); in big_key_free_buffer()
152 kfree(buf); in big_key_free_buffer()
[all …]
Dprocess_keys.c83 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 …]
Dpersistent.c79 char buf[32]; in key_get_persistent() local
85 index_key.description = buf; in key_get_persistent()
86 index_key.desc_len = sprintf(buf, "_persistent.%u", from_kuid(ns, uid)); in key_get_persistent()
/security/apparmor/
Dpath.c48 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 …]
Dapparmorfs.c413 static ssize_t policy_update(u32 mask, const char __user *buf, size_t size, in policy_update() argument
429 data = aa_simple_write_to_buffer(buf, size, size, pos); in policy_update()
441 static ssize_t profile_load(struct file *f, const char __user *buf, size_t size, in profile_load() argument
445 int error = policy_update(AA_MAY_LOAD_POLICY, buf, size, pos, ns); in profile_load()
458 static ssize_t profile_replace(struct file *f, const char __user *buf, in profile_replace() argument
463 buf, size, pos, ns); in profile_replace()
475 static ssize_t profile_remove(struct file *f, const char __user *buf, in profile_remove() argument
495 data = aa_simple_write_to_buffer(buf, size + 1, size, pos); in profile_remove()
532 static ssize_t ns_revision_read(struct file *file, char __user *buf, in ns_revision_read() argument
560 return simple_read_from_buffer(buf, size, ppos, buffer, avail); in ns_revision_read()
[all …]
/security/safesetid/
Dsecurityfs.c30 static int parse_policy_line(struct file *file, char *buf, in parse_policy_line() argument
38 child_str = strchr(buf, ':'); in parse_policy_line()
44 ret = kstrtou32(buf, 0, &parsed_parent); in parse_policy_line()
114 char *buf, *p, *end; in handle_policy_update() local
123 p = buf = memdup_user_nul(ubuf, len); in handle_policy_update()
124 if (IS_ERR(buf)) { in handle_policy_update()
125 err = PTR_ERR(buf); in handle_policy_update()
128 pol->policy_str = kstrdup(buf, GFP_KERNEL); in handle_policy_update()
188 kfree(buf); in handle_policy_update()
196 const char __user *buf, in safesetid_file_write() argument
[all …]
/security/tomoyo/
Drealpath.c237 char *buf = NULL; in tomoyo_realpath_from_path() local
251 kfree(buf); in tomoyo_realpath_from_path()
252 buf = kmalloc(buf_len, GFP_NOFS); in tomoyo_realpath_from_path()
253 if (!buf) in tomoyo_realpath_from_path()
256 buf[buf_len - 1] = '\0'; in tomoyo_realpath_from_path()
259 pos = dentry->d_op->d_dname(dentry, buf, buf_len - 1); in tomoyo_realpath_from_path()
270 pos = tomoyo_get_local_path(path->dentry, buf, in tomoyo_realpath_from_path()
274 pos = tomoyo_get_absolute_path(path, buf, buf_len - 1); in tomoyo_realpath_from_path()
280 pos = tomoyo_get_local_path(path->dentry, buf, in tomoyo_realpath_from_path()
289 kfree(buf); in tomoyo_realpath_from_path()
[all …]
Daudit.c247 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()
368 char *buf; in tomoyo_write_log2() local
[all …]
Dfile.c130 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 …]
Dnetwork.c124 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 …]
Dsecurityfs_if.c41 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()
175 static ssize_t tomoyo_read(struct file *file, char __user *buf, size_t count, in tomoyo_read() argument
178 return tomoyo_read_control(file->private_data, buf, count); in tomoyo_read()
191 static ssize_t tomoyo_write(struct file *file, const char __user *buf, in tomoyo_write() argument
194 return tomoyo_write_control(file->private_data, buf, count); in tomoyo_write()
/security/selinux/
Dselinuxfs.c121 static ssize_t sel_read_enforce(struct file *filp, char __user *buf, in sel_read_enforce() argument
130 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); in sel_read_enforce()
134 static ssize_t sel_write_enforce(struct file *file, const char __user *buf, in sel_write_enforce() argument
151 page = memdup_user_nul(buf, count); in sel_write_enforce()
199 static ssize_t sel_read_handle_unknown(struct file *filp, char __user *buf, in sel_read_handle_unknown() argument
212 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); in sel_read_handle_unknown()
233 static ssize_t sel_read_handle_status(struct file *filp, char __user *buf, in sel_read_handle_status() argument
240 return simple_read_from_buffer(buf, count, ppos, in sel_read_handle_status()
275 static ssize_t sel_write_disable(struct file *file, const char __user *buf, in sel_write_disable() argument
292 page = memdup_user_nul(buf, count); in sel_write_disable()
[all …]
/security/smack/
Dsmackfs.c443 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()
831 static ssize_t smk_set_cipso(struct file *file, const char __user *buf, in smk_set_cipso() argument
859 data = memdup_user_nul(buf, count); in smk_set_cipso()
929 static ssize_t smk_write_cipso(struct file *file, const char __user *buf, in smk_write_cipso() argument
932 return smk_set_cipso(file, buf, count, ppos, SMK_FIXED24_FMT); in smk_write_cipso()
1003 static ssize_t smk_write_cipso2(struct file *file, const char __user *buf, in smk_write_cipso2() argument
1006 return smk_set_cipso(file, buf, count, ppos, SMK_LONG_FMT); in smk_write_cipso2()
[all …]
/security/integrity/ima/
Dima_kexec.c26 file.buf = vmalloc(segment_size); in ima_dump_measurement_list()
27 if (!file.buf) { in ima_dump_measurement_list()
61 memcpy(file.buf, &khdr, sizeof(khdr)); in ima_dump_measurement_list()
64 16, 1, file.buf, in ima_dump_measurement_list()
68 *buffer = file.buf; in ima_dump_measurement_list()
71 vfree(file.buf); in ima_dump_measurement_list()
Dima_modsig.c60 int ima_read_modsig(enum ima_hooks func, const void *buf, loff_t buf_len, in ima_read_modsig() argument
73 p = buf + buf_len - marker_len; in ima_read_modsig()
92 hdr->pkcs7_msg = pkcs7_parse_message(buf + buf_len, sig_len); in ima_read_modsig()
99 memcpy(hdr->raw_pkcs7, buf + buf_len, sig_len); in ima_read_modsig()
117 void ima_collect_modsig(struct modsig *modsig, const void *buf, loff_t size) in ima_collect_modsig() argument
127 rc = pkcs7_supply_detached_data(modsig->pkcs7_msg, buf, size); in ima_collect_modsig()
Dima_main.c193 u32 secid, char *buf, loff_t size, int mask, in process_measurement() argument
316 rc = ima_read_modsig(func, buf, size, &modsig); in process_measurement()
326 rc = ima_collect_measurement(iint, file, buf, size, hash_algo, modsig); in process_measurement()
543 int ima_post_read_file(struct file *file, void *buf, loff_t size, in ima_post_read_file() argument
562 if (!file || !buf || size == 0) { /* should never happen */ in ima_post_read_file()
570 return process_measurement(file, current_cred(), secid, buf, size, in ima_post_read_file()
634 static void process_buffer_measurement(const void *buf, int size, in process_buffer_measurement() argument
643 .buf = buf, in process_buffer_measurement()
663 ret = ima_calc_buffer_hash(buf, size, iint.ima_hash); in process_buffer_measurement()
671 ret = ima_store_template(entry, violation, NULL, buf, pcr); in process_buffer_measurement()
[all …]
Dima_template_lib.c35 u8 *buf, *buf_ptr; in ima_write_template_field_data() local
41 buf = kzalloc(buflen, GFP_KERNEL); in ima_write_template_field_data()
42 if (!buf) in ima_write_template_field_data()
45 memcpy(buf, data, datalen); in ima_write_template_field_data()
55 for (buf_ptr = buf; buf_ptr - buf < datalen; buf_ptr++) in ima_write_template_field_data()
60 field_data->data = buf; in ima_write_template_field_data()
438 if ((!event_data->buf) || (event_data->buf_len == 0)) in ima_eventbuf_init()
441 return ima_write_template_field_data(event_data->buf, in ima_eventbuf_init()
Dima.h65 const void *buf; member
138 int ima_calc_buffer_hash(const void *buf, loff_t len,
157 int ima_restore_measurement_list(loff_t bufsize, void *buf);
213 struct file *file, void *buf, loff_t size,
316 int ima_read_modsig(enum ima_hooks func, const void *buf, loff_t buf_len,
318 void ima_collect_modsig(struct modsig *modsig, const void *buf, loff_t size);
330 static inline int ima_read_modsig(enum ima_hooks func, const void *buf, in ima_read_modsig() argument
336 static inline void ima_collect_modsig(struct modsig *modsig, const void *buf, in ima_collect_modsig() argument
Dima_crypto.c531 static int calc_buffer_ahash_atfm(const void *buf, loff_t len, in calc_buffer_ahash_atfm() argument
555 sg_init_one(&sg, buf, len); in calc_buffer_ahash_atfm()
571 static int calc_buffer_ahash(const void *buf, loff_t len, in calc_buffer_ahash() argument
581 rc = calc_buffer_ahash_atfm(buf, len, hash, tfm); in calc_buffer_ahash()
588 static int calc_buffer_shash_tfm(const void *buf, loff_t size, in calc_buffer_shash_tfm() argument
606 rc = crypto_shash_update(shash, buf, len); in calc_buffer_shash_tfm()
609 buf += len; in calc_buffer_shash_tfm()
618 static int calc_buffer_shash(const void *buf, loff_t len, in calc_buffer_shash() argument
628 rc = calc_buffer_shash_tfm(buf, len, hash, tfm); in calc_buffer_shash()
634 int ima_calc_buffer_hash(const void *buf, loff_t len, in ima_calc_buffer_hash() argument
[all …]
Dima_fs.c42 static ssize_t ima_show_htable_value(char __user *buf, size_t count, in ima_show_htable_value() argument
49 return simple_read_from_buffer(buf, count, ppos, tmpbuf, len); in ima_show_htable_value()
53 char __user *buf, in ima_show_htable_violations() argument
56 return ima_show_htable_value(buf, count, ppos, &ima_htable.violations); in ima_show_htable_violations()
65 char __user *buf, in ima_show_measurements_count() argument
68 return ima_show_htable_value(buf, count, ppos, &ima_htable.len); in ima_show_measurements_count()
312 static ssize_t ima_write_policy(struct file *file, const char __user *buf, in ima_write_policy() argument
326 data = memdup_user_nul(buf, datalen); in ima_write_policy()
/security/integrity/evm/
Devm_secfs.c41 static ssize_t evm_read_key(struct file *filp, char __user *buf, in evm_read_key() argument
51 rc = simple_read_from_buffer(buf, count, ppos, temp, strlen(temp)); in evm_read_key()
68 static ssize_t evm_write_key(struct file *file, const char __user *buf, in evm_write_key() argument
76 ret = kstrtoint_from_user(buf, count, 0, &i); in evm_write_key()
128 static ssize_t evm_read_xattrs(struct file *filp, char __user *buf, in evm_read_xattrs() argument
158 rc = simple_read_from_buffer(buf, count, ppos, temp, strlen(temp)); in evm_read_xattrs()
174 static ssize_t evm_write_xattrs(struct file *file, const char __user *buf, in evm_write_xattrs() argument
203 xattr->name = memdup_user_nul(buf, count); in evm_write_xattrs()
/security/lockdown/
Dlockdown.c115 static ssize_t lockdown_read(struct file *filp, char __user *buf, size_t count, in lockdown_read() argument
138 return simple_read_from_buffer(buf, count, ppos, temp, strlen(temp)); in lockdown_read()
141 static ssize_t lockdown_write(struct file *file, const char __user *buf, in lockdown_write() argument
147 state = memdup_user_nul(buf, n); in lockdown_write()

12