Home
last modified time | relevance | path

Searched refs:size (Results 1 – 25 of 63) sorted by relevance

123

/security/apparmor/
Dpolicy_unpack.c140 if (l->size != r->size) in aa_rawdata_eq()
144 return memcmp(l->data, r->data, r->size) == 0; in aa_rawdata_eq()
179 struct aa_loaddata *aa_loaddata_alloc(size_t size) in aa_loaddata_alloc() argument
186 d->data = kvzalloc(size, GFP_KERNEL); in aa_loaddata_alloc()
198 static bool inbounds(struct aa_ext *e, size_t size) in inbounds() argument
200 return (size <= e->end - e->pos); in inbounds()
221 size_t size = 0; in unpack_u16_chunk() local
226 size = le16_to_cpu(get_unaligned((__le16 *) e->pos)); in unpack_u16_chunk()
228 if (!inbounds(e, size)) in unpack_u16_chunk()
231 e->pos += size; in unpack_u16_chunk()
[all …]
Dlabel.c401 bool aa_label_init(struct aa_label *label, int size, gfp_t gfp) in aa_label_init() argument
404 AA_BUG(size < 1); in aa_label_init()
409 label->size = size; /* doesn't include null */ in aa_label_init()
410 label->vec[size] = NULL; /* null terminate */ in aa_label_init()
426 struct aa_label *aa_label_alloc(int size, struct aa_proxy *proxy, gfp_t gfp) in aa_label_alloc() argument
430 AA_BUG(size < 1); in aa_label_alloc()
433 new = kzalloc(sizeof(*new) + sizeof(struct aa_profile *) * (size + 1), in aa_label_alloc()
439 if (!aa_label_init(new, size, gfp)) in aa_label_alloc()
476 return vec_cmp(a->vec, a->size, b->vec, b->size); in label_cmp()
485 for (; i < label->size; i++) { in aa_label_next_confined()
[all …]
Dapparmorfs.c404 data->size = copy_size; in aa_simple_write_to_buffer()
413 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()
459 size_t size, loff_t *pos) in profile_replace() argument
463 buf, size, pos, ns); in profile_replace()
476 size_t size, loff_t *pos) in profile_remove() argument
495 data = aa_simple_write_to_buffer(buf, size + 1, size, pos); in profile_remove()
499 data->data[size] = 0; in profile_remove()
[all …]
Dmatch.c281 struct aa_dfa *aa_dfa_unpack(void *blob, size_t size, int flags) in aa_dfa_unpack() argument
296 if (size < sizeof(struct table_set_header)) in aa_dfa_unpack()
303 if (size < hsize) in aa_dfa_unpack()
311 size -= hsize; in aa_dfa_unpack()
313 while (size > 0) { in aa_dfa_unpack()
314 table = unpack_table(data, size); in aa_dfa_unpack()
349 size -= table_size(table->td_lolen, table->td_flags); in aa_dfa_unpack()
619 wb->pos = (wb->pos + 1) & (wb->size - 1); \
620 wb->len = (wb->len + 1) & (wb->size - 1); \
639 pos = wb->size; in is_loop()
/security/integrity/ima/
Dima_queue.c77 int size = 0; in get_binary_runtime_size() local
79 size += sizeof(u32); /* pcr */ in get_binary_runtime_size()
80 size += sizeof(entry->digest); in get_binary_runtime_size()
81 size += sizeof(int); /* template name size field */ in get_binary_runtime_size()
82 size += strlen(entry->template_desc->name); in get_binary_runtime_size()
83 size += sizeof(entry->template_data_len); in get_binary_runtime_size()
84 size += entry->template_data_len; in get_binary_runtime_size()
85 return size; in get_binary_runtime_size()
117 int size; in ima_add_digest_entry() local
119 size = get_binary_runtime_size(entry); in ima_add_digest_entry()
[all …]
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
644 .buf_len = size}; in process_buffer_measurement()
663 ret = ima_calc_buffer_hash(buf, size, iint.ima_hash); in process_buffer_measurement()
687 void ima_kexec_cmdline(const void *buf, int size) in ima_kexec_cmdline() argument
[all …]
Dima_crypto.c38 unsigned long long size; in param_set_bufsize() local
41 size = memparse(val, NULL); in param_set_bufsize()
42 order = get_order(size); in param_set_bufsize()
158 static void ima_free_pages(void *ptr, size_t size) in ima_free_pages() argument
162 free_pages((unsigned long)ptr, get_order(size)); in ima_free_pages()
588 static int calc_buffer_shash_tfm(const void *buf, loff_t size, in calc_buffer_shash_tfm() argument
604 while (size) { in calc_buffer_shash_tfm()
605 len = size < PAGE_SIZE ? size : PAGE_SIZE; in calc_buffer_shash_tfm()
610 size -= len; in calc_buffer_shash_tfm()
Dima_fs.c209 void ima_print_digest(struct seq_file *m, u8 *digest, u32 size) in ima_print_digest() argument
213 for (i = 0; i < size; i++) in ima_print_digest()
279 loff_t size; in ima_read_policy() local
288 rc = kernel_read_file_from_path(path, &data, &size, 0, READING_POLICY); in ima_read_policy()
295 while (size > 0 && (p = strsep(&datap, "\n"))) { in ima_read_policy()
300 size -= rc; in ima_read_policy()
306 else if (size) in ima_read_policy()
Dima_modsig.c117 void ima_collect_modsig(struct modsig *modsig, const void *buf, loff_t size) in ima_collect_modsig() argument
125 size -= modsig->raw_pkcs7_len + strlen(MODULE_SIG_STRING) + in ima_collect_modsig()
127 rc = pkcs7_supply_detached_data(modsig->pkcs7_msg, buf, size); in ima_collect_modsig()
/security/integrity/platform_certs/
Defi_parser.c39 const void *data, size_t size, in parse_efi_signature_list() argument
45 pr_devel("-->%s(,%zu)\n", __func__, size); in parse_efi_signature_list()
47 while (size > 0) { in parse_efi_signature_list()
52 if (size < sizeof(list)) in parse_efi_signature_list()
66 if (lsize > size) { in parse_efi_signature_list()
84 size -= lsize; in parse_efi_signature_list()
90 size -= sizeof(list) + hsize; in parse_efi_signature_list()
102 size -= esize; in parse_efi_signature_list()
Dload_uefi.c31 unsigned long size = sizeof(db); in uefi_check_ignore_db() local
34 status = efi.get_variable(L"MokIgnoreDB", &guid, NULL, &size, &db); in uefi_check_ignore_db()
42 unsigned long *size) in get_cert_list() argument
66 *size = lsize; in get_cert_list()
/security/selinux/ss/
Dsymtab.c15 unsigned int size; in symhash() local
20 size = strlen(keyp); in symhash()
21 for (p = keyp; (p - keyp) < size; p++) in symhash()
23 return val & (h->size - 1); in symhash()
36 int symtab_init(struct symtab *s, unsigned int size) in symtab_init() argument
38 s->table = hashtab_create(symhash, symcmp, size); in symtab_init()
Dhashtab.c17 u32 size) in hashtab_create() argument
26 p->size = size; in hashtab_create()
30 p->htable = kmalloc_array(size, sizeof(*p->htable), GFP_KERNEL); in hashtab_create()
36 for (i = 0; i < size; i++) in hashtab_create()
107 for (i = 0; i < h->size; i++) { in hashtab_destroy()
134 for (i = 0; i < h->size; i++) { in hashtab_map()
154 for (i = 0; i < h->size; i++) { in hashtab_stat()
Dsidtab.h38 #define size_to_shift(size) ((size) == 1 ? 1 : (const_ilog2((size) - 1) + 1)) argument
Dhashtab.h24 u32 size; /* number of slots in hash table */ member
45 u32 size);
/security/
Dcommoncap.c345 static bool is_v2header(size_t size, const struct vfs_cap_data *cap) in is_v2header() argument
347 if (size != XATTR_CAPS_SZ_2) in is_v2header()
352 static bool is_v3header(size_t size, const struct vfs_cap_data *cap) in is_v3header() argument
354 if (size != XATTR_CAPS_SZ_3) in is_v3header()
373 int size, ret; in cap_inode_getsecurity() local
389 size = sizeof(struct vfs_ns_cap_data); in cap_inode_getsecurity()
391 &tmpbuf, size, GFP_NOFS); in cap_inode_getsecurity()
425 return size; in cap_inode_getsecurity()
434 size = sizeof(struct vfs_cap_data); in cap_inode_getsecurity()
436 *buffer = kmalloc(size, GFP_ATOMIC); in cap_inode_getsecurity()
[all …]
/security/apparmor/include/
Dlib.h104 char *aa_str_alloc(int size, gfp_t gfp);
222 if ((L)->size > 1) { \
228 if (vec_setup(label, __lvec, (L)->size, (GFP))) { \
240 for (__j = __count = 0; __j < (L)->size; __j++) \
241 __count += __lvec[__j]->size; \
243 for (__j = __k = 0; __j < (L)->size; __j++) { \
260 vec_cleanup(label, __lvec, (L)->size); \
Dlabel.h54 #define cleanup_domain_vec(V, L) cleanup_label_vec((V), (L)->size)
133 int size; member
149 #define labels_ns(X) (vec_ns(&((X)->vec[0]), (X)->size))
151 #define labels_profile(X) ((X)->vec[(X)->size - 1])
167 if ((I).j >= (L2)->size) { \
280 bool aa_label_init(struct aa_label *label, int size, gfp_t gfp);
281 struct aa_label *aa_label_alloc(int size, struct aa_proxy *proxy, gfp_t gfp);
310 int aa_label_snxprint(char *str, size_t size, struct aa_ns *view,
/security/selinux/
Dnetport.c39 int size; member
113 if (sel_netport_hash[idx].size == SEL_NETPORT_HASH_BKT_LIMIT) { in sel_netport_insert()
123 sel_netport_hash[idx].size++; in sel_netport_insert()
219 sel_netport_hash[idx].size = 0; in sel_netport_flush()
233 sel_netport_hash[iter].size = 0; in sel_netport_init()
Dibpkey.c33 int size; member
103 if (sel_ib_pkey_hash[idx].size == SEL_PKEY_HASH_BKT_LIMIT) { in sel_ib_pkey_insert()
114 sel_ib_pkey_hash[idx].size++; in sel_ib_pkey_insert()
216 sel_ib_pkey_hash[idx].size = 0; in sel_ib_pkey_flush()
230 sel_ib_pkey_hash[iter].size = 0; in sel_ib_pkey_init()
Dnetnode.c40 unsigned int size; member
165 if (sel_netnode_hash[idx].size == SEL_NETNODE_HASH_BKT_LIMIT) { in sel_netnode_insert()
174 sel_netnode_hash[idx].size++; in sel_netnode_insert()
285 sel_netnode_hash[idx].size = 0; in sel_netnode_flush()
299 sel_netnode_hash[iter].size = 0; in sel_netnode_init()
Dselinuxfs.c249 unsigned long size = vma->vm_end - vma->vm_start; in sel_mmap_handle_status() local
254 if (vma->vm_pgoff > 0 || size != PAGE_SIZE) in sel_mmap_handle_status()
264 size, vma->vm_page_prot); in sel_mmap_handle_status()
592 static ssize_t sel_write_context(struct file *file, char *buf, size_t size) in sel_write_context() argument
606 length = security_context_to_sid(state, buf, size, &sid, GFP_KERNEL); in sel_write_context()
763 static ssize_t sel_write_access(struct file *file, char *buf, size_t size);
764 static ssize_t sel_write_create(struct file *file, char *buf, size_t size);
765 static ssize_t sel_write_relabel(struct file *file, char *buf, size_t size);
766 static ssize_t sel_write_user(struct file *file, char *buf, size_t size);
767 static ssize_t sel_write_member(struct file *file, char *buf, size_t size);
[all …]
/security/integrity/
Ddigsig.c148 off_t size, key_perm_t perm) in integrity_add_key() argument
157 NULL, data, size, perm, in integrity_add_key()
175 loff_t size; in integrity_load_x509() local
179 rc = kernel_read_file_from_path(path, &data, &size, 0, in integrity_load_x509()
189 rc = integrity_add_key(id, (const void *)data, size, perm); in integrity_load_x509()
/security/tomoyo/
Dmemory.c74 void *tomoyo_commit_ok(void *data, const unsigned int size) in tomoyo_commit_ok() argument
76 void *ptr = kzalloc(size, GFP_NOFS); in tomoyo_commit_ok()
79 memmove(ptr, data, size); in tomoyo_commit_ok()
80 memset(data, 0, size); in tomoyo_commit_ok()
Dcommon.h654 u32 size; /* Memory size allocated for this entry. */ member
1002 int size);
1005 int tomoyo_update_domain(struct tomoyo_acl_info *new_entry, const int size,
1013 int tomoyo_update_policy(struct tomoyo_acl_head *new_entry, const int size,
1044 void *tomoyo_commit_ok(void *data, const unsigned int size);
1059 void tomoyo_print_ip(char *buf, const unsigned int size,
1291 static inline int tomoyo_round2(size_t size) in tomoyo_round2() argument
1293 return size; in tomoyo_round2()
1308 static inline int tomoyo_round2(size_t size) in tomoyo_round2() argument
1315 if (!size) in tomoyo_round2()
[all …]

123