Home
last modified time | relevance | path

Searched refs:ADD_OVERFLOW (Results 1 – 25 of 48) sorted by relevance

12

/optee_os/core/pta/tests/
H A Dmisc.c36 if (ADD_OVERFLOW(8U, 0U, &r_s32)) in self_test_add_overflow()
40 if (ADD_OVERFLOW(32U, 30U, &r_u32)) in self_test_add_overflow()
44 if (!ADD_OVERFLOW(UINT32_MAX, UINT32_MAX, &r_u32)) in self_test_add_overflow()
46 if (!ADD_OVERFLOW(UINT32_MAX / 2 + 1, UINT32_MAX / 2 + 1, &r_u32)) in self_test_add_overflow()
48 if (ADD_OVERFLOW(UINT32_MAX / 2, UINT32_MAX / 2 + 1, &r_u32)) in self_test_add_overflow()
53 if (ADD_OVERFLOW((uint32_t)30, (int32_t)-31, &r_s32)) in self_test_add_overflow()
57 if (ADD_OVERFLOW((int32_t)30, (int32_t)-31, &r_s32)) in self_test_add_overflow()
61 if (ADD_OVERFLOW((int32_t)-31, (uint32_t)30, &r_s32)) in self_test_add_overflow()
66 if (ADD_OVERFLOW(INT32_MIN + 1, -1, &r_s32)) in self_test_add_overflow()
70 if (!ADD_OVERFLOW(INT32_MIN, -1, &r_s32)) in self_test_add_overflow()
[all …]
/optee_os/core/include/
H A Dsigned_hdr.h57 if (ADD_OVERFLOW(s, shdr->hash_size, &s) || in shdr_get_size()
58 ADD_OVERFLOW(s, shdr->sig_size, &s)) in shdr_get_size()
173 if (ADD_OVERFLOW(s, ehdr->iv_size, &s) || in shdr_enc_get_size()
174 ADD_OVERFLOW(s, ehdr->tag_size, &s)) in shdr_enc_get_size()
/optee_os/core/kernel/
H A Dtransfer_list.c272 if (ADD_OVERFLOW(cur->hdr_size, cur->data_size, &sz)) in transfer_list_next()
275 if (ADD_OVERFLOW(va, sz, &va) || in transfer_list_next()
285 ADD_OVERFLOW(tl_e->hdr_size, tl_e->data_size, &sz) || in transfer_list_next()
286 ADD_OVERFLOW(va, sz, &ev) || ev > tl_ev) in transfer_list_next()
373 if (ADD_OVERFLOW(tl_e->hdr_size, tl_e->data_size, &sz) || in transfer_list_set_data_size()
374 ADD_OVERFLOW((vaddr_t)tl_e, sz, &old_ev) || in transfer_list_set_data_size()
378 if (ADD_OVERFLOW(tl_e->hdr_size, new_data_size, &sz) || in transfer_list_set_data_size()
379 ADD_OVERFLOW((vaddr_t)tl_e, sz, &new_ev) || in transfer_list_set_data_size()
486 if (ADD_OVERFLOW(sizeof(*tl_e), data_size, &sz) || in transfer_list_add()
487 ADD_OVERFLOW(ev, sz, &ev) || ev > max_tl_ev) in transfer_list_add()
H A Dree_fs_ta.c304 if (ADD_OVERFLOW(offs, shdr->img_size, &offs) || in ree_fs_ta_open()
305 ADD_OVERFLOW(offs, pub_key.name_size, &offs) || in ree_fs_ta_open()
388 if (ADD_OVERFLOW(sz, sizeof(*bs_hdr), &sz) || ta_size < sz) { in ree_fs_ta_open()
426 if (ADD_OVERFLOW(sz, sizeof(struct shdr_bootstrap_ta), &sz) || in ree_fs_ta_open()
427 ADD_OVERFLOW(sz, sizeof(img_ehdr), &sz) || in ree_fs_ta_open()
436 if (!ehdr_sz || ADD_OVERFLOW(sz, ehdr_sz, &sz) || in ree_fs_ta_open()
566 if (ADD_OVERFLOW(handle->offs, len, &next_offs) || in ree_fs_ta_read()
780 if (ADD_OVERFLOW(handle->offs, len, &next_offs) || in buf_ta_read()
H A Dmsg_param.c126 if (ADD_OVERFLOW(size, page_offset, &size_plus_offs)) in msg_param_mobj_from_noncontig()
H A Dldelf_syscalls.c98 if (ADD_OVERFLOW(va, sz, &end_va)) in ldelf_syscall_unmap()
257 if (ADD_OVERFLOW(offs_bytes, num_bytes, &next_offs)) in binh_copy_to()
521 if (ADD_OVERFLOW(va, sz, &end_va)) in ldelf_syscall_set_prot()
H A Dembedded_ts.c129 if (ADD_OVERFLOW(h->offs, len, &next_offs) || in read_uncompressed()
H A Duser_access.c136 if (uctx && !ADD_OVERFLOW(uctx->bbuf_offs, len, &offs) && in bb_alloc()
/optee_os/core/crypto/
H A Dsigned_hdr.c28 if (ADD_OVERFLOW(offs, sizeof(struct shdr), &end) || end > img_size) in shdr_alloc_and_copy()
32 if (!shdr_size || ADD_OVERFLOW(offs, shdr_size, &end) || end > img_size) in shdr_alloc_and_copy()
35 if (ADD_OVERFLOW(img_va, shdr_size, &tmp)) in shdr_alloc_and_copy()
188 ADD_OVERFLOW(end, sizeof(*subkey), &end) || in check_attrs()
193 if (ADD_OVERFLOW(attrs[n].offs, attrs[n].size, &end) || in check_attrs()
279 if (ADD_OVERFLOW(shdr->img_size, offs, &end) || end > ns_img_size) in shdr_load_pub_key()
319 if (ADD_OVERFLOW(key->name_size, offs + shdr->img_size, &end) || in shdr_load_pub_key()
/optee_os/ta/pkcs11/src/
H A Dserializer.c48 if (ADD_OVERFLOW(buf0_sz, size, &sz)) in alloc_and_get()
86 if (ADD_OVERFLOW((vaddr_t)args->next, size, &next_end)) in serialargs_get_ptr()
181 if (ADD_OVERFLOW(*blen, len, &nlen)) in serialize()
H A Dsanitize_object.c57 if (ADD_OVERFLOW(*pos, sizeof(*attr), &data_pos) || data_pos > blen) in read_attr_advance()
61 if (ADD_OVERFLOW(data_pos, attr->size, &next_pos) || next_pos > blen) in read_attr_advance()
264 if (ADD_OVERFLOW(sizeof(head), head.attrs_size, &sz_from_hdr) || in sanitize_client_object()
/optee_os/lib/libutee/include/
H A Dremoteproc_pta.h43 if (!keyinf || ADD_OVERFLOW(sizeof(*keyinf), keyinf->info_size, &s)) in rproc_pta_keyinfo_size()
/optee_os/core/tee/
H A Dtee_svc_storage.c107 if (ADD_OVERFLOW(sizeof(head), head.attr_size, &tmp)) { in tee_svc_storage_read_head()
740 if (ADD_OVERFLOW(o->info.dataPosition, len, &pos_tmp)) { in syscall_storage_obj_read()
748 if (ADD_OVERFLOW(o->ds_pos, o->info.dataPosition, &pos_tmp)) { in syscall_storage_obj_read()
792 if (ADD_OVERFLOW(o->info.dataPosition, len, &pos_tmp)) { in syscall_storage_obj_write()
799 if (ADD_OVERFLOW(o->ds_pos, o->info.dataPosition, &pos_tmp)) { in syscall_storage_obj_write()
853 if (ADD_OVERFLOW(sizeof(struct tee_svc_storage_head), attr_size, in syscall_storage_obj_trunc()
858 if (ADD_OVERFLOW(len, off, &off)) { in syscall_storage_obj_trunc()
900 if (ADD_OVERFLOW(o->info.dataPosition, offset, &new_pos)) in syscall_storage_obj_seek()
904 if (ADD_OVERFLOW(o->info.dataSize, offset, &new_pos)) in syscall_storage_obj_seek()
/optee_os/core/mm/
H A Dvm.c75 if (ADD_OVERFLOW(prev_reg->va, prev_reg->size, &begin_va) || in select_va_in_range()
76 ADD_OVERFLOW(begin_va, pad_begin, &begin_va) || in select_va_in_range()
77 ADD_OVERFLOW(begin_va, pad, &begin_va) || in select_va_in_range()
97 if (ADD_OVERFLOW(begin_va, reg->size, &end_va) || in select_va_in_range()
98 ADD_OVERFLOW(end_va, pad_end, &end_va) || in select_va_in_range()
99 ADD_OVERFLOW(end_va, pad, &end_va) || in select_va_in_range()
259 if (ADD_OVERFLOW(reg->offset, reg->size, &offs_plus_size)) in umap_add_region()
393 if (ADD_OVERFLOW(va, len, &end_va)) in va_range_is_contiguous()
461 if (ADD_OVERFLOW(va, len, &end_va)) in split_vm_range()
502 if (ADD_OVERFLOW(va, len, &end_va)) in merge_vm_range()
[all …]
H A Dfile.c97 ADD_OVERFLOW(page_offset, fse->slice.fobj->num_pages, &s)) { in file_add_slice()
/optee_os/lib/libutils/ext/include/
H A Dutil.h86 ADD_OVERFLOW((v), __roundup_add, (res)); \
107 ADD_OVERFLOW((v), __roundup_mask, &__roundup_tmp) ? 1 : \
221 #define ADD_OVERFLOW(a, b, res) __compiler_add_overflow((a), (b), (res)) macro
/optee_os/ldelf/
H A Dta_elf_rel.c366 if (ADD_OVERFLOW(shdr[sym_tab_idx].sh_addr, in e32_relocate()
386 if (ADD_OVERFLOW(shdr[str_tab_idx].sh_addr, in e32_relocate()
400 if (ADD_OVERFLOW(shdr[rel_sidx].sh_addr, in e32_relocate()
606 if (ADD_OVERFLOW(shdr[sym_tab_idx].sh_addr, in e64_relocate()
626 if (ADD_OVERFLOW(shdr[str_tab_idx].sh_addr, in e64_relocate()
640 if (ADD_OVERFLOW(shdr[rel_sidx].sh_addr, in e64_relocate()
H A Dta_elf.c205 if (ADD_OVERFLOW(addr, memsz, &max_addr)) in check_phdr_in_range()
242 if (ADD_OVERFLOW((vaddr_t)ptr, sz, &max_addr)) in check_range()
266 if (ADD_OVERFLOW(num_words, num_buckets, &num_words) || in check_hashtab()
267 ADD_OVERFLOW(num_words, num_chains, &num_words) || in check_hashtab()
294 if (ADD_OVERFLOW(num_words, h->nbuckets, &num_words) || in check_gnu_hashtab()
295 ADD_OVERFLOW(num_words, bloom_words, &num_words) || in check_gnu_hashtab()
521 ADD_OVERFLOW(sz, elf->e_phoff, &sz)) in init_elf()
640 assert(!ADD_OVERFLOW(seg->vaddr, seg->memsz, &dummy)); in adjust_segments()
/optee_os/ta/remoteproc/src/
H A Dremoteproc_core.c252 if (ADD_OVERFLOW((uintptr_t)p_tlv, tlv_length, &tmp_p_tlv)) in remoteproc_get_tlv()
369 if (ADD_OVERFLOW(sizeof(*hdr), ROUNDUP_64(hdr->tlv_len), &length) || in remoteproc_save_fw_header_and_tlvs()
370 ADD_OVERFLOW(length, ROUNDUP_64(hdr->sign_len), &length)) in remoteproc_save_fw_header_and_tlvs()
463 if (ADD_OVERFLOW(sizeof(*hdr), ROUNDUP_64(hdr->sign_len), &size) || in remoteproc_verify_header()
464 ADD_OVERFLOW(size, ROUNDUP_64(hdr->img_len), &size) || in remoteproc_verify_header()
465 ADD_OVERFLOW(size, ROUNDUP_64(hdr->tlv_len), &size) || in remoteproc_verify_header()
H A Delf_parser.c159 ADD_OVERFLOW(s, sizeof(struct resource_table), &s) || in e32_parser_find_rsc_table()
/optee_os/core/arch/arm/mm/
H A Dsp_mem.c41 if (ADD_OVERFLOW(sizeof(struct mobj_sp), s, &s)) in mobj_sp_size()
83 if (ADD_OVERFLOW(*idx, num_pages, &n) || n > tot_page_count) in sp_mem_add_pages()
/optee_os/core/pta/
H A Dsystem.c101 if (ADD_OVERFLOW(data_len, params[0].memref.size, &data_len)) in system_derive_ta_unique_key()
211 if (ADD_OVERFLOW(va, sz, &end_va)) in system_unmap()
/optee_os/core/pta/bcm/
H A Delog.c91 if (ADD_OVERFLOW(sz, offset, &end_offs) || in pta_elog_load_nitro_fw()
/optee_os/core/drivers/counter/
H A Dstm32_stgen.c142 if (ADD_OVERFLOW(counter_val, nb_pm_count_ticks, &counter_val)) in stm32_stgen_pm_resume()
/optee_os/core/arch/arm/kernel/
H A Dspmc_sp_handler.c335 ADD_OVERFLOW(needed_size, mem_trans->mem_access_offs, in spmc_sp_add_share()
349 if (ADD_OVERFLOW(addr_range_offs, sizeof(*mem_reg), &needed_size) || in spmc_sp_add_share()
367 ADD_OVERFLOW(needed_size, addr_range_offs, &needed_size) || in spmc_sp_add_share()
384 if (ADD_OVERFLOW(page_count_sum, addr_range->page_count, in spmc_sp_add_share()
667 if (ADD_OVERFLOW(address_offset, sizeof(struct ffa_mem_region), in ffa_mem_retrieve()

12