/security/selinux/ss/ |
D | hashtab.c | 33 u32 size = hashtab_compute_size(nel_hint); in hashtab_init() local 37 h->size = 0; in hashtab_init() 40 if (size) { in hashtab_init() 41 h->htable = kcalloc(size, sizeof(*h->htable), GFP_KERNEL); in hashtab_init() 44 h->size = size; in hashtab_init() 71 for (i = 0; i < h->size; i++) { in hashtab_destroy() 93 for (i = 0; i < h->size; i++) { in hashtab_map() 113 for (i = 0; i < h->size; i++) { in hashtab_stat() 143 new->htable = kcalloc(orig->size, sizeof(*new->htable), GFP_KERNEL); in hashtab_duplicate() 147 new->size = orig->size; in hashtab_duplicate() [all …]
|
D | symtab.c | 15 unsigned int size; in symhash() local 20 size = strlen(keyp); in symhash() 21 for (p = keyp; (p - keyp) < size; p++) in symhash() 40 int symtab_init(struct symtab *s, unsigned int size) in symtab_init() argument 43 return hashtab_init(&s->table, size); in symtab_init()
|
D | hashtab.h | 34 u32 size; /* number of slots in hash table */ member 69 if (!h->size || h->nel == HASHTAB_MAX_NODES) in hashtab_insert() 72 hvalue = key_params.hash(key) & (h->size - 1); in hashtab_insert() 102 if (!h->size) in hashtab_search() 105 hvalue = key_params.hash(key) & (h->size - 1); in hashtab_search()
|
/security/apparmor/ |
D | policy_unpack.c | 141 if (l->size != r->size) in aa_rawdata_eq() 147 return memcmp(l->data, r->data, r->compressed_size ?: r->size) == 0; in aa_rawdata_eq() 182 struct aa_loaddata *aa_loaddata_alloc(size_t size) in aa_loaddata_alloc() argument 189 d->data = kvzalloc(size, GFP_KERNEL); in aa_loaddata_alloc() 201 static bool inbounds(struct aa_ext *e, size_t size) in inbounds() argument 203 return (size <= e->end - e->pos); in inbounds() 224 size_t size = 0; in unpack_u16_chunk() local 229 size = le16_to_cpu(get_unaligned((__le16 *) e->pos)); in unpack_u16_chunk() 231 if (!inbounds(e, size)) in unpack_u16_chunk() 234 e->pos += size; in unpack_u16_chunk() [all …]
|
D | label.c | 396 bool aa_label_init(struct aa_label *label, int size, gfp_t gfp) in aa_label_init() argument 399 AA_BUG(size < 1); in aa_label_init() 404 label->size = size; /* doesn't include null */ in aa_label_init() 405 label->vec[size] = NULL; /* null terminate */ in aa_label_init() 421 struct aa_label *aa_label_alloc(int size, struct aa_proxy *proxy, gfp_t gfp) in aa_label_alloc() argument 425 AA_BUG(size < 1); in aa_label_alloc() 428 new = kzalloc(sizeof(*new) + sizeof(struct aa_profile *) * (size + 1), in aa_label_alloc() 434 if (!aa_label_init(new, size, gfp)) in aa_label_alloc() 471 return vec_cmp(a->vec, a->size, b->vec, b->size); in label_cmp() 480 for (; i < label->size; i++) { in aa_label_next_confined() [all …]
|
D | policy_unpack_test.c | 189 size_t size; in policy_unpack_test_unpack_blob_with_null_name() local 192 size = unpack_blob(puf->e, &blob, NULL); in policy_unpack_test_unpack_blob_with_null_name() 194 KUNIT_ASSERT_EQ(test, size, TEST_BLOB_DATA_SIZE); in policy_unpack_test_unpack_blob_with_null_name() 203 size_t size; in policy_unpack_test_unpack_blob_with_name() local 206 size = unpack_blob(puf->e, &blob, TEST_BLOB_NAME); in policy_unpack_test_unpack_blob_with_name() 208 KUNIT_ASSERT_EQ(test, size, TEST_BLOB_DATA_SIZE); in policy_unpack_test_unpack_blob_with_name() 218 int size; in policy_unpack_test_unpack_blob_out_of_bounds() local 225 size = unpack_blob(puf->e, &blob, TEST_BLOB_NAME); in policy_unpack_test_unpack_blob_out_of_bounds() 227 KUNIT_EXPECT_EQ(test, size, 0); in policy_unpack_test_unpack_blob_out_of_bounds() 235 size_t size; in policy_unpack_test_unpack_str_with_null_name() local [all …]
|
D | apparmorfs.c | 84 static struct rawdata_f_data *rawdata_f_data_alloc(size_t size) in rawdata_f_data_alloc() argument 88 if (size > SIZE_MAX - sizeof(*ret)) in rawdata_f_data_alloc() 91 ret = kvzalloc(sizeof(*ret) + size, GFP_KERNEL); in rawdata_f_data_alloc() 402 data->size = copy_size; in aa_simple_write_to_buffer() 411 static ssize_t policy_update(u32 mask, const char __user *buf, size_t size, in policy_update() argument 427 data = aa_simple_write_to_buffer(buf, size, size, pos); in policy_update() 440 static ssize_t profile_load(struct file *f, const char __user *buf, size_t size, in profile_load() argument 444 int error = policy_update(AA_MAY_LOAD_POLICY, buf, size, pos, ns); in profile_load() 458 size_t size, loff_t *pos) in profile_replace() argument 462 buf, size, pos, ns); in profile_replace() [all …]
|
/security/integrity/platform_certs/ |
D | efi_parser.c | 39 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()
|
D | load_powerpc.c | 21 static __init void *get_cert_list(u8 *key, unsigned long keylen, uint64_t *size) in get_cert_list() argument 26 rc = secvar_ops->get(key, keylen, NULL, size); in get_cert_list() 32 db = kmalloc(*size, GFP_KERNEL); in get_cert_list() 36 rc = secvar_ops->get(key, keylen, db, size); in get_cert_list()
|
D | load_uefi.c | 54 unsigned long size = sizeof(db); in uefi_check_ignore_db() local 57 status = efi.get_variable(L"MokIgnoreDB", &guid, NULL, &size, &db); in uefi_check_ignore_db() 65 unsigned long *size, efi_status_t *status) in get_cert_list() argument 91 *size = lsize; in get_cert_list()
|
/security/integrity/ima/ |
D | ima_queue.c | 76 int size = 0; in get_binary_runtime_size() local 78 size += sizeof(u32); /* pcr */ in get_binary_runtime_size() 79 size += TPM_DIGEST_SIZE; in get_binary_runtime_size() 80 size += sizeof(int); /* template name size field */ in get_binary_runtime_size() 81 size += strlen(entry->template_desc->name); in get_binary_runtime_size() 82 size += sizeof(entry->template_data_len); in get_binary_runtime_size() 83 size += entry->template_data_len; in get_binary_runtime_size() 84 return size; in get_binary_runtime_size() 116 int size; in ima_add_digest_entry() local 118 size = get_binary_runtime_size(entry); in ima_add_digest_entry() [all …]
|
D | ima_main.c | 203 u32 secid, char *buf, loff_t size, int mask, in process_measurement() argument 341 rc = ima_read_modsig(func, buf, size, &modsig); in process_measurement() 351 rc = ima_collect_measurement(iint, file, buf, size, hash_algo, modsig); in process_measurement() 755 int ima_post_read_file(struct file *file, void *buf, loff_t size, in ima_post_read_file() argument 765 if (!file || !buf || size == 0) { /* should never happen */ in ima_post_read_file() 773 return process_measurement(file, current_cred(), secid, buf, size, in ima_post_read_file() 843 int ima_post_load_data(char *buf, loff_t size, in ima_post_load_data() argument 880 struct inode *inode, const void *buf, int size, in process_buffer_measurement() argument 892 .buf_len = size}; in process_buffer_measurement() 940 ret = ima_calc_buffer_hash(buf, size, iint.ima_hash); in process_buffer_measurement() [all …]
|
D | ima_fs.c | 208 void ima_print_digest(struct seq_file *m, u8 *digest, u32 size) in ima_print_digest() argument 212 for (i = 0; i < size; i++) in ima_print_digest() 278 size_t size; in ima_read_policy() local 293 size = rc; in ima_read_policy() 297 while (size > 0 && (p = strsep(&datap, "\n"))) { in ima_read_policy() 302 size -= rc; in ima_read_policy() 308 else if (size) in ima_read_policy()
|
D | ima_modsig.c | 100 void ima_collect_modsig(struct modsig *modsig, const void *buf, loff_t size) in ima_collect_modsig() argument 108 size -= modsig->raw_pkcs7_len + strlen(MODULE_SIG_STRING) + in ima_collect_modsig() 110 rc = pkcs7_supply_detached_data(modsig->pkcs7_msg, buf, size); in ima_collect_modsig()
|
/security/ |
D | commoncap.c | 353 static bool is_v2header(size_t size, const struct vfs_cap_data *cap) in is_v2header() argument 355 if (size != XATTR_CAPS_SZ_2) in is_v2header() 360 static bool is_v3header(size_t size, const struct vfs_cap_data *cap) in is_v3header() argument 362 if (size != XATTR_CAPS_SZ_3) in is_v3header() 382 int size, ret; in cap_inode_getsecurity() local 399 size = sizeof(struct vfs_ns_cap_data); in cap_inode_getsecurity() 401 &tmpbuf, size, GFP_NOFS); in cap_inode_getsecurity() 405 size = ret; in cap_inode_getsecurity() 417 size = -EINVAL; in cap_inode_getsecurity() 430 size = sizeof(struct vfs_ns_cap_data); in cap_inode_getsecurity() [all …]
|
/security/apparmor/include/ |
D | lib.h | 109 char *aa_str_alloc(int size, gfp_t gfp); 227 if ((L)->size > 1) { \ 233 if (vec_setup(label, __lvec, (L)->size, (GFP))) { \ 245 for (__j = __count = 0; __j < (L)->size; __j++) \ 246 __count += __lvec[__j]->size; \ 248 for (__j = __k = 0; __j < (L)->size; __j++) { \ 265 vec_cleanup(label, __lvec, (L)->size); \
|
D | label.h | 54 #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) { \ 281 bool aa_label_init(struct aa_label *label, int size, gfp_t gfp); 282 struct aa_label *aa_label_alloc(int size, struct aa_proxy *proxy, gfp_t gfp); 312 int aa_label_snxprint(char *str, size_t size, struct aa_ns *view,
|
/security/selinux/ |
D | ibpkey.c | 33 int size; member 102 if (sel_ib_pkey_hash[idx].size == SEL_PKEY_HASH_BKT_LIMIT) { in sel_ib_pkey_insert() 113 sel_ib_pkey_hash[idx].size++; in sel_ib_pkey_insert() 217 sel_ib_pkey_hash[idx].size = 0; in sel_ib_pkey_flush() 231 sel_ib_pkey_hash[iter].size = 0; in sel_ib_pkey_init()
|
D | netport.c | 39 int size; member 112 if (sel_netport_hash[idx].size == SEL_NETPORT_HASH_BKT_LIMIT) { in sel_netport_insert() 122 sel_netport_hash[idx].size++; in sel_netport_insert() 218 sel_netport_hash[idx].size = 0; in sel_netport_flush() 232 sel_netport_hash[iter].size = 0; in sel_netport_init()
|
D | netnode.c | 40 unsigned int size; member 164 if (sel_netnode_hash[idx].size == SEL_NETNODE_HASH_BKT_LIMIT) { in sel_netnode_insert() 173 sel_netnode_hash[idx].size++; in sel_netnode_insert() 284 sel_netnode_hash[idx].size = 0; in sel_netnode_flush() 298 sel_netnode_hash[iter].size = 0; in sel_netnode_init()
|
/security/keys/trusted-keys/ |
D | trusted_tee.c | 96 param[0].u.memref.size = p->key_len; in trusted_tee_seal() 100 param[1].u.memref.size = sizeof(p->blob); in trusted_tee_seal() 109 p->blob_len = param[1].u.memref.size; in trusted_tee_seal() 157 param[0].u.memref.size = p->blob_len; in trusted_tee_unseal() 161 param[1].u.memref.size = sizeof(p->key); in trusted_tee_unseal() 170 p->key_len = param[1].u.memref.size; in trusted_tee_unseal() 208 param[0].u.memref.size = key_len; in trusted_tee_get_random() 217 ret = param[0].u.memref.size; in trusted_tee_get_random()
|
/security/integrity/ |
D | digsig.c | 153 off_t size, key_perm_t perm) in integrity_add_key() argument 162 NULL, data, size, perm, in integrity_add_key() 180 size_t size; in integrity_load_x509() local 190 size = rc; in integrity_load_x509() 195 rc = integrity_add_key(id, (const void *)data, size, perm); in integrity_load_x509()
|
/security/integrity/evm/ |
D | evm_crypto.c | 222 int size, user_space_size; in evm_calc_hmac_or_hash() local 268 size = vfs_getxattr_alloc(&init_user_ns, dentry, xattr->name, in evm_calc_hmac_or_hash() 270 if (size == -ENOMEM) { in evm_calc_hmac_or_hash() 274 if (size < 0) in evm_calc_hmac_or_hash() 279 if (user_space_size != size) in evm_calc_hmac_or_hash() 281 dentry->d_name.name, xattr->name, size, in evm_calc_hmac_or_hash() 284 xattr_size = size; in evm_calc_hmac_or_hash()
|
/security/tomoyo/ |
D | memory.c | 74 void *tomoyo_commit_ok(void *data, const unsigned int size) in tomoyo_commit_ok() argument 76 void *ptr = kzalloc(size, GFP_NOFS | __GFP_NOWARN); in tomoyo_commit_ok() 79 memmove(ptr, data, size); in tomoyo_commit_ok() 80 memset(data, 0, size); in tomoyo_commit_ok()
|
/security/landlock/ |
D | syscalls.c | 106 const size_t size, loff_t *const ppos) in fop_dummy_read() argument 113 const char __user *const buf, const size_t size, in fop_dummy_write() argument 159 const size_t, size, const __u32, flags) in SYSCALL_DEFINE3() argument 173 !size) in SYSCALL_DEFINE3() 182 attr, size); in SYSCALL_DEFINE3()
|