Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 65) sorted by relevance

123

/security/integrity/platform_certs/
Dkeyring_handler.c22 size_t len, const char *type, in uefi_blacklist_hash() argument
27 hash = kmalloc(type_len + len * 2 + 1, GFP_KERNEL); in uefi_blacklist_hash()
32 bin2hex(p, data, len); in uefi_blacklist_hash()
33 p += len * 2; in uefi_blacklist_hash()
44 const void *data, size_t len) in uefi_blacklist_x509_tbs() argument
46 uefi_blacklist_hash(source, data, len, "tbs:", 4); in uefi_blacklist_x509_tbs()
53 const void *data, size_t len) in uefi_blacklist_binary() argument
55 uefi_blacklist_hash(source, data, len, "bin:", 4); in uefi_blacklist_binary()
62 const void *data, size_t len) in uefi_revocation_list_x509() argument
64 add_key_to_revocation_list(data, len); in uefi_revocation_list_x509()
Dload_ipl_s390.c21 unsigned int len; in load_ipl_certs() local
29 len = *(unsigned int *) ptr; in load_ipl_certs()
31 add_to_platform_keyring("IPL:db", ptr, len); in load_ipl_certs()
32 ptr += len; in load_ipl_certs()
Dkeyring_handler.h9 size_t len, const char *type,
15 void blacklist_x509_tbs(const char *source, const void *data, size_t len);
20 void blacklist_binary(const char *source, const void *data, size_t len);
/security/apparmor/
Dprocattr.c37 int len; in aa_getprocattr() local
44 len = aa_label_snxprint(NULL, 0, current_ns, label, in aa_getprocattr()
47 AA_BUG(len < 0); in aa_getprocattr()
49 *string = kmalloc(len + 2, GFP_KERNEL); in aa_getprocattr()
55 len = aa_label_snxprint(*string, len + 2, current_ns, label, in aa_getprocattr()
58 if (len < 0) { in aa_getprocattr()
60 return len; in aa_getprocattr()
63 (*string)[len] = '\n'; in aa_getprocattr()
64 (*string)[len + 1] = 0; in aa_getprocattr()
67 return len + 1; in aa_getprocattr()
Dlabel.c854 int len, gfp_t gfp) in vec_create_and_insert_label() argument
864 if (len == 1) in vec_create_and_insert_label()
867 ls = labels_set(&vec[len - 1]->label); in vec_create_and_insert_label()
872 new = aa_label_alloc(len, NULL, gfp); in vec_create_and_insert_label()
876 for (i = 0; i < len; i++) in vec_create_and_insert_label()
887 struct aa_label *aa_vec_find_or_create_label(struct aa_profile **vec, int len, in aa_vec_find_or_create_label() argument
890 struct aa_label *label = vec_find(vec, len); in aa_vec_find_or_create_label()
895 return vec_create_and_insert_label(vec, len, gfp); in aa_vec_find_or_create_label()
1487 #define update_for_len(total, len, size, str) \ argument
1489 size_t ulen = len; \
[all …]
Dsecid.c74 int len; in apparmor_secid_to_secctx() local
82 len = aa_label_asxprint(secdata, root_ns, label, in apparmor_secid_to_secctx()
87 len = aa_label_snxprint(NULL, 0, root_ns, label, in apparmor_secid_to_secctx()
90 if (len < 0) in apparmor_secid_to_secctx()
93 *seclen = len; in apparmor_secid_to_secctx()
Dcrypto.c28 char *aa_calc_hash(void *data, size_t len) in aa_calc_hash() argument
46 error = crypto_shash_update(desc, (u8 *) data, len); in aa_calc_hash()
62 size_t len) in aa_calc_profile_hash() argument
86 error = crypto_shash_update(desc, (u8 *) start, len); in aa_calc_profile_hash()
/security/selinux/ss/
Dconditional.c30 if (expr->len == 0) in cond_evaluate_expr()
33 for (i = 0; i < expr->len; i++) { in cond_evaluate_expr()
104 for (i = 0; i < node->true_list.len; i++) { in evaluate_cond_node()
112 for (i = 0; i < node->false_list.len; i++) { in evaluate_cond_node()
213 u32 len; in cond_read_bool() local
231 len = le32_to_cpu(buf[2]); in cond_read_bool()
232 if (((len == 0) || (len == (u32)-1))) in cond_read_bool()
236 key = kmalloc(len + 1, GFP_KERNEL); in cond_read_bool()
239 rc = next_entry(key, fp, len); in cond_read_bool()
242 key[len] = '\0'; in cond_read_bool()
[all …]
Dpolicydb.c1075 static int str_read(char **strp, gfp_t flags, void *fp, u32 len) in str_read() argument
1080 if ((len == 0) || (len == (u32)-1)) in str_read()
1083 str = kmalloc(len + 1, flags | __GFP_NOWARN); in str_read()
1087 rc = next_entry(str, fp, len); in str_read()
1093 str[len] = '\0'; in str_read()
1104 u32 len; in perm_read() local
1114 len = le32_to_cpu(buf[0]); in perm_read()
1117 rc = str_read(&key, GFP_KERNEL, fp, len); in perm_read()
1136 u32 len, nel; in common_read() local
1147 len = le32_to_cpu(buf[0]); in common_read()
[all …]
Dpolicydb.h309 size_t len; member
354 size_t len; member
364 if (bytes > fp->len) in next_entry()
369 fp->len -= bytes; in next_entry()
375 size_t len = bytes * num; in put_entry() local
377 if (len > fp->len) in put_entry()
379 memcpy(fp->data, buf, len); in put_entry()
380 fp->data += len; in put_entry()
381 fp->len -= len; in put_entry()
Dcontext.h31 u32 len; /* length of string in bytes */ member
161 dst->len = src->len; in context_cpy()
164 dst->len = 0; in context_cpy()
179 c->len = 0; in context_destroy()
185 if (c1->len && c2->len) in context_cmp()
186 return (c1->len == c2->len && !strcmp(c1->str, c2->str)); in context_cmp()
187 if (c1->len || c2->len) in context_cmp()
/security/tomoyo/
Daudit.c29 int len; in tomoyo_print_bprm() local
38 len = snprintf(buffer, tomoyo_buffer_len - 1, "argv[]={ "); in tomoyo_print_bprm()
39 cp = buffer + len; in tomoyo_print_bprm()
244 char *tomoyo_init_log(struct tomoyo_request_info *r, int len, const char *fmt, in tomoyo_init_log() argument
259 len += strlen(domainname) + strlen(header) + 10; in tomoyo_init_log()
268 len += strlen(realpath) + 80 + strlen(bprm_info); in tomoyo_init_log()
272 len += 18 + strlen(symlink); in tomoyo_init_log()
274 len = tomoyo_round2(len); in tomoyo_init_log()
275 buf = kzalloc(len, GFP_NOFS); in tomoyo_init_log()
278 len--; in tomoyo_init_log()
[all …]
Dutil.c146 static bool tomoyo_correct_path2(const char *filename, const size_t len);
386 const int len = strlen(find); in tomoyo_str_starts() local
389 if (strncmp(tmp, find, len)) in tomoyo_str_starts()
391 tmp += len; in tomoyo_str_starts()
435 static bool tomoyo_correct_word2(const char *string, size_t len) in tomoyo_correct_word2() argument
441 if (!len) in tomoyo_correct_word2()
443 while (len--) { in tomoyo_correct_word2()
447 if (!len--) in tomoyo_correct_word2()
454 if (!len-- || !len--) in tomoyo_correct_word2()
531 static bool tomoyo_correct_path2(const char *filename, const size_t len) in tomoyo_correct_path2() argument
[all …]
Dsecurityfs_if.c104 loff_t len = strlen(domain); in tomoyo_read_self() local
107 if (pos >= len || !count) in tomoyo_read_self()
109 len -= pos; in tomoyo_read_self()
110 if (count < len) in tomoyo_read_self()
111 len = count; in tomoyo_read_self()
112 if (copy_to_user(buf, domain + pos, len)) in tomoyo_read_self()
114 *ppos += len; in tomoyo_read_self()
115 return len; in tomoyo_read_self()
Dcommon.c196 static void tomoyo_addprintf(char *buffer, int len, const char *fmt, ...) in tomoyo_addprintf() argument
202 vsnprintf(buffer + pos, len - pos - 1, fmt, args); in tomoyo_addprintf()
217 size_t len = strlen(w); in tomoyo_flush() local
219 if (len) { in tomoyo_flush()
220 if (len > head->read_user_buf_avail) in tomoyo_flush()
221 len = head->read_user_buf_avail; in tomoyo_flush()
222 if (!len) in tomoyo_flush()
224 if (copy_to_user(head->read_user_buf, w, len)) in tomoyo_flush()
226 head->read_user_buf_avail -= len; in tomoyo_flush()
227 head->read_user_buf += len; in tomoyo_flush()
[all …]
Ddomain.c439 (const char *name, const unsigned int len) in tomoyo_find_namespace() argument
444 if (strncmp(name, ns->name, len) || in tomoyo_find_namespace()
445 (name[len] && name[len] != ' ')) in tomoyo_find_namespace()
467 unsigned int len = 0; in tomoyo_assign_namespace() local
470 len++; in tomoyo_assign_namespace()
471 ptr = tomoyo_find_namespace(domainname, len); in tomoyo_assign_namespace()
474 if (len >= TOMOYO_EXEC_TMPSIZE - 10 || !tomoyo_domain_def(domainname)) in tomoyo_assign_namespace()
476 entry = kzalloc(sizeof(*entry) + len + 1, GFP_NOFS | __GFP_NOWARN); in tomoyo_assign_namespace()
479 ptr = tomoyo_find_namespace(domainname, len); in tomoyo_assign_namespace()
484 memmove(name, domainname, len); in tomoyo_assign_namespace()
[all …]
/security/selinux/
Dnetlink.c43 static void selnl_add_payload(struct nlmsghdr *nlh, int len, int msgtype, void *data) in selnl_add_payload() argument
49 memset(msg, 0, len); in selnl_add_payload()
57 memset(msg, 0, len); in selnl_add_payload()
69 int len; in selnl_notify() local
74 len = selnl_msglen(msgtype); in selnl_notify()
76 skb = nlmsg_new(len, GFP_USER); in selnl_notify()
81 nlh = nlmsg_put(skb, 0, 0, msgtype, len, 0); in selnl_notify()
84 selnl_add_payload(nlh, len, msgtype, data); in selnl_notify()
Dselinuxfs.c391 size_t len; member
421 rc = security_read_policy(state, &plm->data, &plm->len); in sel_open_policy()
425 if ((size_t)i_size_read(inode) != plm->len) { in sel_open_policy()
427 i_size_write(inode, plm->len); in sel_open_policy()
474 return simple_read_from_buffer(buf, count, ppos, plm->data, plm->len); in sel_read_policy()
487 if (offset >= roundup(plm->len, PAGE_SIZE)) in sel_mmap_policy_fault()
681 u32 sid, len; in sel_write_context() local
694 length = security_sid_to_context(state, sid, &canon, &len); in sel_write_context()
699 if (len > SIMPLE_TRANSACTION_LIMIT) { in sel_write_context()
701 "payload max\n", __func__, len); in sel_write_context()
[all …]
/security/integrity/ima/
Dima_template.c211 int i, len; in template_desc_init_fields() local
225 i++, template_fmt_ptr += len + 1) { in template_desc_init_fields()
228 len = strchrnul(template_fmt_ptr, '|') - template_fmt_ptr; in template_desc_init_fields()
229 if (len == 0 || len > IMA_TEMPLATE_FIELD_ID_MAX_LEN) { in template_desc_init_fields()
230 pr_err("Invalid field with length %d\n", len); in template_desc_init_fields()
234 memcpy(tmp_field_id, template_fmt_ptr, len); in template_desc_init_fields()
235 tmp_field_id[len] = '\0'; in template_desc_init_fields()
391 kzalloc(field_data->len + 1, GFP_KERNEL); in ima_restore_template_data()
396 memcpy((*entry)->template_data[i].data, data, field_data->len); in ima_restore_template_data()
397 (*entry)->template_data_len += sizeof(field_data->len); in ima_restore_template_data()
[all …]
Dima_crypto.c601 u32 datalen = field_data[i].len; in ima_calc_field_array_hash_tfm()
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()
688 ahash_request_set_crypt(req, &sg, NULL, 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()
725 unsigned int len; in calc_buffer_shash_tfm() local
737 len = size < PAGE_SIZE ? size : PAGE_SIZE; in calc_buffer_shash_tfm()
738 rc = crypto_shash_update(shash, buf, len); in calc_buffer_shash_tfm()
741 buf += len; in calc_buffer_shash_tfm()
[all …]
Dima_template_lib.c62 field_data->len = buflen; in ima_write_template_field_data()
72 u32 buflen = field_data->len; in ima_show_template_data_ascii()
94 switch (field_data->len) { in ima_show_template_data_ascii()
133 u32 len = (show == IMA_SHOW_BINARY_OLD_STRING_FMT) ? in ima_show_template_data_binary() local
134 strlen(field_data->data) : field_data->len; in ima_show_template_data_binary()
138 len : (__force u32)cpu_to_le32(len); in ima_show_template_data_binary()
143 if (!len) in ima_show_template_data_binary()
146 ima_putc(m, field_data->data, len); in ima_show_template_data_binary()
232 fields[i].len = le32_to_cpu(*(__le32 *)bufp); in ima_parse_buf()
234 fields[i].len = *(u32 *)bufp; in ima_parse_buf()
[all …]
/security/safesetid/
Dsecurityfs.c140 const char __user *ubuf, size_t len, enum setid_type policy_type) in handle_policy_update() argument
153 p = buf = memdup_user_nul(ubuf, len); in handle_policy_update()
225 err = len; in handle_policy_update()
237 size_t len, in safesetid_uid_file_write() argument
246 return handle_policy_update(file, buf, len, UID); in safesetid_uid_file_write()
251 size_t len, in safesetid_gid_file_write() argument
260 return handle_policy_update(file, buf, len, GID); in safesetid_gid_file_write()
264 … size_t len, loff_t *ppos, struct mutex *policy_update_lock, struct __rcu setid_ruleset* ruleset) in safesetid_file_read() argument
274 res = simple_read_from_buffer(buf, len, ppos, in safesetid_file_read()
283 size_t len, loff_t *ppos) in safesetid_uid_file_read() argument
[all …]
/security/apparmor/include/
Dcrypto.h17 char *aa_calc_hash(void *data, size_t len);
19 size_t len);
21 static inline char *aa_calc_hash(void *data, size_t len) in aa_calc_hash() argument
26 void *start, size_t len) in aa_calc_profile_hash() argument
Dmatch.h120 static inline size_t table_size(size_t len, size_t el_size) in table_size() argument
122 return ALIGN(sizeof(struct table_header) + len * el_size, 8); in table_size()
130 const char *str, int len);
148 unsigned int len; member
156 .len = 0, \
/security/lockdown/
Dlockdown.c120 int i, len, err = -EINVAL; in lockdown_write() local
126 len = strlen(state); in lockdown_write()
127 if (len && state[len-1] == '\n') { in lockdown_write()
128 state[len-1] = '\0'; in lockdown_write()
129 len--; in lockdown_write()

123