Home
last modified time | relevance | path

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

123

/security/keys/
Dtrusted.h21 int len; member
25 #define INIT_BUF(tb) (tb->len = 0)
77 int len; in dump_tpm_buf() local
80 len = LOAD32(buf, TPM_SIZE_OFFSET); in dump_tpm_buf()
81 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 1, buf, len, 0); in dump_tpm_buf()
103 buf->data[buf->len++] = value; in store8()
108 *(uint16_t *) & buf->data[buf->len] = htons(value); in store16()
109 buf->len += sizeof value; in store16()
114 *(uint32_t *) & buf->data[buf->len] = htonl(value); in store32()
115 buf->len += sizeof value; in store32()
[all …]
/security/apparmor/
Dprocattr.c41 int len; in aa_getprocattr() local
48 len = aa_label_snxprint(NULL, 0, current_ns, label, in aa_getprocattr()
51 AA_BUG(len < 0); in aa_getprocattr()
53 *string = kmalloc(len + 2, GFP_KERNEL); in aa_getprocattr()
59 len = aa_label_snxprint(*string, len + 2, current_ns, label, in aa_getprocattr()
62 if (len < 0) { in aa_getprocattr()
64 return len; in aa_getprocattr()
67 (*string)[len] = '\n'; in aa_getprocattr()
68 (*string)[len + 1] = 0; in aa_getprocattr()
71 return len + 1; in aa_getprocattr()
Dlabel.c831 int len, gfp_t gfp) in vec_create_and_insert_label() argument
841 if (len == 1) in vec_create_and_insert_label()
844 ls = labels_set(&vec[len - 1]->label); in vec_create_and_insert_label()
849 new = aa_label_alloc(len, NULL, gfp); in vec_create_and_insert_label()
853 for (i = 0; i < len; i++) in vec_create_and_insert_label()
864 struct aa_label *aa_vec_find_or_create_label(struct aa_profile **vec, int len, in aa_vec_find_or_create_label() argument
867 struct aa_label *label = vec_find(vec, len); in aa_vec_find_or_create_label()
872 return vec_create_and_insert_label(vec, len, gfp); in aa_vec_find_or_create_label()
1464 #define update_for_len(total, len, size, str) \ argument
1466 size_t ulen = len; \
[all …]
Dcrypto.c32 char *aa_calc_hash(void *data, size_t len) in aa_calc_hash() argument
51 error = crypto_shash_update(desc, (u8 *) data, len); in aa_calc_hash()
67 size_t len) in aa_calc_profile_hash() argument
92 error = crypto_shash_update(desc, (u8 *) start, len); in aa_calc_profile_hash()
/security/tomoyo/
Daudit.c29 int len; in tomoyo_print_bprm() local
37 len = snprintf(buffer, tomoyo_buffer_len - 1, "argv[]={ "); in tomoyo_print_bprm()
38 cp = buffer + len; in tomoyo_print_bprm()
242 char *tomoyo_init_log(struct tomoyo_request_info *r, int len, const char *fmt, in tomoyo_init_log() argument
256 len += strlen(domainname) + strlen(header) + 10; in tomoyo_init_log()
264 len += strlen(realpath) + 80 + strlen(bprm_info); in tomoyo_init_log()
268 len += 18 + strlen(symlink); in tomoyo_init_log()
270 len = tomoyo_round2(len); in tomoyo_init_log()
271 buf = kzalloc(len, GFP_NOFS); in tomoyo_init_log()
274 len--; in tomoyo_init_log()
[all …]
Dutil.c397 const int len = strlen(find); in tomoyo_str_starts() local
400 if (strncmp(tmp, find, len)) in tomoyo_str_starts()
402 tmp += len; in tomoyo_str_starts()
446 static bool tomoyo_correct_word2(const char *string, size_t len) in tomoyo_correct_word2() argument
453 if (!len) in tomoyo_correct_word2()
455 while (len--) { in tomoyo_correct_word2()
458 if (!len--) in tomoyo_correct_word2()
491 if (!len-- || !len--) in tomoyo_correct_word2()
577 int len; in tomoyo_domain_def() local
582 len = strlen(buffer); in tomoyo_domain_def()
[all …]
Dsecurityfs_if.c105 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
201 vsnprintf(buffer + pos, len - pos - 1, fmt, args); in tomoyo_addprintf()
216 size_t len = strlen(w); in tomoyo_flush() local
217 if (len) { in tomoyo_flush()
218 if (len > head->read_user_buf_avail) in tomoyo_flush()
219 len = head->read_user_buf_avail; in tomoyo_flush()
220 if (!len) in tomoyo_flush()
222 if (copy_to_user(head->read_user_buf, w, len)) in tomoyo_flush()
224 head->read_user_buf_avail -= len; in tomoyo_flush()
225 head->read_user_buf += len; in tomoyo_flush()
[all …]
Ddomain.c426 (const char *name, const unsigned int len) in tomoyo_find_namespace() argument
430 if (strncmp(name, ns->name, len) || in tomoyo_find_namespace()
431 (name[len] && name[len] != ' ')) in tomoyo_find_namespace()
453 unsigned int len = 0; in tomoyo_assign_namespace() local
455 len++; in tomoyo_assign_namespace()
456 ptr = tomoyo_find_namespace(domainname, len); in tomoyo_assign_namespace()
459 if (len >= TOMOYO_EXEC_TMPSIZE - 10 || !tomoyo_domain_def(domainname)) in tomoyo_assign_namespace()
461 entry = kzalloc(sizeof(*entry) + len + 1, GFP_NOFS); in tomoyo_assign_namespace()
466 ptr = tomoyo_find_namespace(domainname, len); in tomoyo_assign_namespace()
470 memmove(name, domainname, len); in tomoyo_assign_namespace()
[all …]
Dmemory.c152 int len; in tomoyo_get_name() local
157 len = strlen(name) + 1; in tomoyo_get_name()
158 hash = full_name_hash(NULL, (const unsigned char *) name, len - 1); in tomoyo_get_name()
169 ptr = kzalloc(sizeof(*ptr) + len, GFP_NOFS); in tomoyo_get_name()
172 memmove((char *) ptr->entry.name, name, len); in tomoyo_get_name()
Drealpath.c25 int len = 0; in tomoyo_encode2() local
36 len += 2; in tomoyo_encode2()
38 len++; in tomoyo_encode2()
40 len += 4; in tomoyo_encode2()
42 len++; in tomoyo_encode2()
44 cp = kzalloc(len + 10, GFP_NOFS); in tomoyo_encode2()
/security/selinux/ss/
Dconditional.c227 u32 len; in cond_read_bool() local
245 len = le32_to_cpu(buf[2]); in cond_read_bool()
246 if (((len == 0) || (len == (u32)-1))) in cond_read_bool()
250 key = kmalloc(len + 1, GFP_KERNEL); in cond_read_bool()
253 rc = next_entry(key, fp, len); in cond_read_bool()
256 key[len] = '\0'; in cond_read_bool()
359 u32 len; in cond_read_av_list() local
364 len = 0; in cond_read_av_list()
369 len = le32_to_cpu(buf[0]); in cond_read_av_list()
370 if (len == 0) in cond_read_av_list()
[all …]
Dcontext.h31 u32 len; /* length of string in bytes */ member
129 dst->len = src->len; in context_cpy()
132 dst->len = 0; in context_cpy()
147 c->len = 0; in context_destroy()
153 if (c1->len && c2->len) in context_cmp()
154 return (c1->len == c2->len && !strcmp(c1->str, c2->str)); in context_cmp()
155 if (c1->len || c2->len) in context_cmp()
Dpolicydb.c1099 static int str_read(char **strp, gfp_t flags, void *fp, u32 len) in str_read() argument
1104 if ((len == 0) || (len == (u32)-1)) in str_read()
1107 str = kmalloc(len + 1, flags | __GFP_NOWARN); in str_read()
1114 rc = next_entry(str, fp, len); in str_read()
1118 str[len] = '\0'; in str_read()
1128 u32 len; in perm_read() local
1138 len = le32_to_cpu(buf[0]); in perm_read()
1141 rc = str_read(&key, GFP_KERNEL, fp, len); in perm_read()
1160 u32 len, nel; in common_read() local
1171 len = le32_to_cpu(buf[0]); in common_read()
[all …]
Dpolicydb.h305 size_t len; member
342 size_t len; member
352 if (bytes > fp->len) in next_entry()
357 fp->len -= bytes; in next_entry()
363 size_t len = bytes * num; in put_entry() local
365 memcpy(fp->data, buf, len); in put_entry()
366 fp->data += len; in put_entry()
367 fp->len -= len; in put_entry()
Dservices.c629 xperms->len = 1; in services_compute_xperms_drivers()
656 xperms->len = 0; in context_struct_compute_av()
1106 xperms->len = 0; in security_compute_av()
1204 if (context->len) { in context_struct_to_string()
1205 *scontext_len = context->len; in context_struct_to_string()
1452 context.len = strlen(str) + 1; in security_context_to_sid_core()
1836 u32 len; in convert_context_handle_invalid_context() local
1841 if (!context_struct_to_string(context, &s, &len)) { in convert_context_handle_invalid_context()
1872 u32 len; in convert_context() local
1889 c->len, &ctx, SECSID_NULL); in convert_context()
[all …]
/security/selinux/
Dnetlink.c46 static void selnl_add_payload(struct nlmsghdr *nlh, int len, int msgtype, void *data) in selnl_add_payload() argument
52 memset(msg, 0, len); in selnl_add_payload()
60 memset(msg, 0, len); in selnl_add_payload()
72 int len; in selnl_notify() local
77 len = selnl_msglen(msgtype); in selnl_notify()
79 skb = nlmsg_new(len, GFP_USER); in selnl_notify()
84 nlh = nlmsg_put(skb, 0, 0, msgtype, len, 0); in selnl_notify()
87 selnl_add_payload(nlh, len, msgtype, data); in selnl_notify()
Dselinuxfs.c335 size_t len; member
368 rc = security_read_policy(&plm->data, &plm->len); in sel_open_policy()
415 ret = simple_read_from_buffer(buf, count, ppos, plm->data, plm->len); in sel_read_policy()
431 if (offset >= roundup(plm->len, PAGE_SIZE)) in sel_mmap_policy_fault()
548 u32 sid, len; in sel_write_context() local
560 length = security_sid_to_context(sid, &canon, &len); in sel_write_context()
565 if (len > SIMPLE_TRANSACTION_LIMIT) { in sel_write_context()
567 "payload max\n", __func__, len); in sel_write_context()
571 memcpy(buf, canon, len); in sel_write_context()
572 length = len; in sel_write_context()
[all …]
/security/integrity/ima/
Dima_template.c162 int i, len; in template_desc_init_fields() local
176 i++, template_fmt_ptr += len + 1) { in template_desc_init_fields()
179 len = strchrnul(template_fmt_ptr, '|') - template_fmt_ptr; in template_desc_init_fields()
180 if (len == 0 || len > IMA_TEMPLATE_FIELD_ID_MAX_LEN) { in template_desc_init_fields()
181 pr_err("Invalid field with length %d\n", len); in template_desc_init_fields()
185 memcpy(tmp_field_id, template_fmt_ptr, len); in template_desc_init_fields()
186 tmp_field_id[len] = '\0'; in template_desc_init_fields()
304 kzalloc(field_data->len + 1, GFP_KERNEL); in ima_restore_template_data()
309 memcpy((*entry)->template_data[i].data, data, field_data->len); in ima_restore_template_data()
310 (*entry)->template_data_len += sizeof(field_data->len); in ima_restore_template_data()
[all …]
Dima_template_lib.c63 field_data->len = buflen; in ima_write_template_field_data()
73 u32 buflen = field_data->len; in ima_show_template_data_ascii()
103 u32 len = (show == IMA_SHOW_BINARY_OLD_STRING_FMT) ? in ima_show_template_data_binary() local
104 strlen(field_data->data) : field_data->len; in ima_show_template_data_binary()
107 u32 field_len = !ima_canonical_fmt ? len : cpu_to_le32(len); in ima_show_template_data_binary()
112 if (!len) in ima_show_template_data_binary()
115 ima_putc(m, field_data->data, len); in ima_show_template_data_binary()
188 fields[i].len = *(u32 *)bufp; in ima_parse_buf()
190 fields[i].len = le32_to_cpu(fields[i].len); in ima_parse_buf()
195 if (bufp > (bufendp - fields[i].len)) in ima_parse_buf()
[all …]
Dima_crypto.c508 u32 datalen = field_data[i].len; in ima_calc_field_array_hash_tfm()
553 static int calc_buffer_ahash_atfm(const void *buf, loff_t len, in calc_buffer_ahash_atfm() argument
577 sg_init_one(&sg, buf, len); in calc_buffer_ahash_atfm()
578 ahash_request_set_crypt(req, &sg, NULL, len); in calc_buffer_ahash_atfm()
593 static int calc_buffer_ahash(const void *buf, loff_t len, in calc_buffer_ahash() argument
603 rc = calc_buffer_ahash_atfm(buf, len, hash, tfm); in calc_buffer_ahash()
615 unsigned int len; in calc_buffer_shash_tfm() local
628 len = size < PAGE_SIZE ? size : PAGE_SIZE; in calc_buffer_shash_tfm()
629 rc = crypto_shash_update(shash, buf, len); in calc_buffer_shash_tfm()
632 buf += len; in calc_buffer_shash_tfm()
[all …]
/security/apparmor/include/
Dcrypto.h21 char *aa_calc_hash(void *data, size_t len);
23 size_t len);
25 static inline char *aa_calc_hash(void *data, size_t len) in aa_calc_hash() argument
30 void *start, size_t len) in aa_calc_profile_hash() argument
Dlib.h77 static inline bool aa_strneq(const char *str, const char *sub, int len) in aa_strneq() argument
79 return !strncmp(str, sub, len) && !str[len]; in aa_strneq()
198 const char *str, int len) in __policy_strn_find() argument
203 if (aa_strneq(policy->name, str, len)) in __policy_strn_find()
/security/smack/
Dsmack_access.c448 char *smk_parse_smack(const char *string, int len) in smk_parse_smack() argument
453 if (len <= 0) in smk_parse_smack()
454 len = strlen(string) + 1; in smk_parse_smack()
464 for (i = 0; i < len; i++) in smk_parse_smack()
490 int len) in smk_netlbl_mls() argument
502 for (cat = 1, cp = catset, byte = 0; byte < len; cp++, byte++) in smk_netlbl_mls()
526 struct smack_known *smk_import_entry(const char *string, int len) in smk_import_entry() argument
533 smack = smk_parse_smack(string, len); in smk_import_entry()
/security/selinux/include/
Dconditional.h16 int security_get_bools(int *len, char ***names, int **values);
18 int security_set_bools(int len, int *values);

123