Closed shefty closed 2 years ago
Error: CLANG_WARNING: [#def184]
libfabric-1.12.1/prov/sockets/src/sock_atomic.c:225:3: warning[deadcode.DeadStores]: Value stored to 'src_len' is never read
# 223| goto err;
# 224| } else {
# 225|-> src_len = dst_len;
# 226| }
# 227|
Error: ATOMICITY (CWE-667): [#def185]
libfabric-1.12.1/prov/sockets/src/sock_cntr.c:314: lock: Locking "&cntr->mut".
libfabric-1.12.1/prov/sockets/src/sock_cntr.c:332: def: Assigning data that might be protected by the lock to "last_read".
libfabric-1.12.1/prov/sockets/src/sock_cntr.c:337: unlock: Unlocking "&cntr->mut". "last_read" might now be unreliable because other threads can now change the data that it depends on.
libfabric-1.12.1/prov/sockets/src/sock_cntr.c:339: lockagain: Locking "&cntr->mut" again.
libfabric-1.12.1/prov/sockets/src/sock_cntr.c:357: use: Using an unreliable value of "last_read" inside the second locked section. If the data that "last_read" depends on was changed by another thread, this use might be incorrect.
# 355| }
# 356|
# 357|-> ofi_atomic_set32(&cntr->last_read_val, last_read);
# 358| ofi_atomic_dec32(&cntr->num_waiting);
# 359|
Error: CLANG_WARNING: [#def186]
libfabric-1.12.1/prov/sockets/src/sock_conn.c:71:2: warning[deadcode.DeadStores]: Value stored to 'total_len' is never read
# 69| SOCK_LOG_DBG("New conn msg on TX: %p using conn: %p\n", tx_ctx, conn);
# 70|
# 71|-> total_len = 0;
# 72| tx_op.src_iov_len = sizeof(union ofi_sock_ip);
# 73| total_len = tx_op.src_iov_len + sizeof(struct sock_op_send);
Error: CLANG_WARNING: [#def187]
libfabric-1.12.1/prov/sockets/src/sock_conn.c:345:16: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
# 343|
# 344| for (i = 0; i < num_fds; i++) {
# 345|-> conn_handle = ep_contexts[i];
# 346|
# 347| if (conn_handle == NULL) { /* signal event */
Error: CLANG_WARNING: [#def188]
libfabric-1.12.1/prov/sockets/src/sock_cq.c:305:61: warning[unix.Malloc]: Use of memory after it is freed
# 303| ofi_rbcommit(&cq->addr_rb);
# 304|
# 305|-> ofi_rbfdwrite(&cq->cq_rbfd, &overflow_entry->cq_entry[0], overflow_entry->len);
# 306| if (cq->domain->progress_mode == FI_PROGRESS_MANUAL)
# 307| ofi_rbcommit(&cq->cq_rbfd.rb);
Error: CLANG_WARNING: [#def189]
libfabric-1.12.1/prov/sockets/src/sock_ctx.c:78:3: warning[unix.Malloc]: Use of memory after it is freed
# 76| /* free any remaining buffered entries */
# 77| while (!dlist_empty(&rx_ctx->rx_buffered_list)) {
# 78|-> dlist_pop_front(&rx_ctx->rx_buffered_list,
# 79| struct sock_rx_entry, rx_buffered, entry);
# 80| free(rx_buffered);
Error: CLANG_WARNING: [#def190]
libfabric-1.12.1/prov/sockets/src/sock_ep_msg.c:413:3: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
# 411|
# 412| cm_entry->fid = &ep->ep.fid;
# 413|-> memcpy(&cm_entry->data, param, cm_data_sz);
# 414| ep->attr->cm.state = SOCK_CM_STATE_CONNECTED;
# 415| ep->attr->cm.sock = sock_fd;
Error: CLANG_WARNING: [#def191]
libfabric-1.12.1/prov/sockets/src/sock_ep_msg.c:1198:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
# 1196| }
# 1197| for (i = 0; i < num_fds; i++) {
# 1198|-> handle = ep_contexts[i];
# 1199|
# 1200| if (handle == NULL) { /* Signal event */
Error: SLEEP (CWE-367): [#def192]
libfabric-1.12.1/prov/sockets/src/sock_ep_msg.c:1187: lock_acquire: Calling function "pthread_mutex_lock" acquires lock "cm_head->signal_lock".
libfabric-1.12.1/prov/sockets/src/sock_ep_msg.c:1216: sleep: Call to "sock_ep_cm_handle_rx" might sleep while holding lock "cm_head->signal_lock".
# 1214|
# 1215| assert(handle->sock_fd != INVALID_SOCKET);
# 1216|-> sock_ep_cm_handle_rx(cm_head, handle);
# 1217| }
# 1218| skip:
Error: CLANG_WARNING: [#def193]
libfabric-1.12.1/prov/sockets/src/sock_poll.c:90:7: warning[unix.Malloc]: Use of memory after it is freed
# 88| for (p = head->next; p != head; p = p->next) {
# 89| list_item = container_of(p, struct sock_fid_list, entry);
# 90|-> if (list_item->fid == event_fid) {
# 91| dlist_remove(p);
# 92| switch (list_item->fid->fclass) {
Error: TAINTED_SCALAR (CWE-20): [#def194]
libfabric-1.12.1/prov/sockets/src/sock_progress.c:895: tainted_argument: Calling function "sock_pe_recv_field" taints argument "pe_entry->pe.rx.rx_op".
libfabric-1.12.1/prov/sockets/src/sock_progress.c:908: var_assign_var: Assigning: "*entry_len" = "24UL * pe_entry->pe.rx.rx_op.dest_iov_len". Both are now tainted.
libfabric-1.12.1/prov/sockets/src/sock_progress.c:909: tainted_data: Passing tainted expression "*entry_len" to "sock_pe_recv_field", which uses it as an offset.
libfabric-1.12.1/prov/sockets/src/sock_progress.c:909: remediation: Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
# 907| /* dst iocs */
# 908| *entry_len = sizeof(union sock_iov) * pe_entry->pe.rx.rx_op.dest_iov_len;
# 909|-> if (sock_pe_recv_field(pe_entry, &pe_entry->pe.rx.rx_iov[0],
# 910| *entry_len, len))
# 911| return -FI_EAGAIN;
Error: TAINTED_SCALAR (CWE-20): [#def195]
libfabric-1.12.1/prov/sockets/src/sock_progress.c:895: tainted_argument: Calling function "sock_pe_recv_field" taints argument "pe_entry->pe.rx.rx_op".
libfabric-1.12.1/prov/sockets/src/sock_progress.c:916: lower_bounds: Casting narrower unsigned "pe_entry->pe.rx.rx_op.dest_iov_len" to wider signed type "int" effectively tests its lower bound.
libfabric-1.12.1/prov/sockets/src/sock_progress.c:916: tainted_data: Using tainted variable "pe_entry->pe.rx.rx_op.dest_iov_len" as a loop boundary.
libfabric-1.12.1/prov/sockets/src/sock_progress.c:916: remediation: Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
# 914| *entry_len = 0;
# 915| *datatype_sz = ofi_datatype_size(pe_entry->pe.rx.rx_op.atomic.datatype);
# 916|-> for (i = 0; i < pe_entry->pe.rx.rx_op.dest_iov_len; i++) {
# 917| *entry_len += pe_entry->pe.rx.rx_iov[i].ioc.count;
# 918| }
Error: RESOURCE_LEAK (CWE-772): [#def222] [important]
libfabric-1.12.1/prov/util/src/util_av.c:862: alloc_arg: "ofi_ip_av_sym_getaddr" allocates memory that is stored into "addr".
libfabric-1.12.1/prov/util/src/util_av.c:865: leaked_storage: Variable "addr" going out of scope leaks the storage it points to.
# 863| svccnt, &addr, &addrlen);
# 864| if (count <= 0)
# 865|-> return count;
# 866|
# 867| ret = ofi_ip_av_insertv(av, addr, addrlen, count,
Error: BAD_SHIFT (CWE-682): [#def223]
libfabric-1.12.1/prov/util/src/util_coll.c:602: zero_return: Function call "ofi_lsb(rank)" returns 0.
libfabric-1.12.1/prov/util/src/util_coll.c:602: negative_shift: In expression "1 << ofi_lsb(rank) - 1", shifting by a negative amount has undefined behavior. The shift amount, "ofi_lsb(rank) - 1", is -1.
# 600| static size_t util_binomial_tree_values_to_recv(uint64_t rank, size_t numranks)
# 601| {
# 602|-> size_t nvalues = 0x1 << (ofi_lsb(rank) - 1);
# 603| if (numranks < rank + nvalues)
# 604| nvalues = numranks - rank;
Error: LOCK (CWE-667): [#def224]
libfabric-1.12.1/prov/util/src/util_mem_monitor.c:314: lock: "pthread_mutex_lock" locks "mm_lock".
libfabric-1.12.1/prov/util/src/util_mem_monitor.c:316: missing_unlock: Returning without unlocking "mm_lock".
# 314| pthread_mutex_lock(&mm_lock);
# 315| }
# 316|-> }
# 317|
# 318| int ofi_monitor_subscribe(struct ofi_mem_monitor *monitor,
Error: CLANG_WARNING: [#def225]
libfabric-1.12.1/prov/util/src/util_mr_map.c:234:31: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
# 232|
# 233| if (FI_VERSION_GE(user_version, FI_VERSION(1, 5))) {
# 234|-> cur_abi_attr->auth_key_size = user_attr->auth_key_size;
# 235| cur_abi_attr->auth_key = user_attr->auth_key;
# 236| } else {
Error: CLANG_WARNING: [#def226]
libfabric-1.12.1/prov/util/src/util_wait.c:125:3: warning[unix.Malloc]: Use of memory after it is freed
# 123|
# 124| while (!dlist_empty(&wait->fid_list)) {
# 125|-> dlist_pop_front(&wait->fid_list, struct ofi_wait_fid_entry,
# 126| fid_entry, entry);
# 127| free(fid_entry->pollfds.fd);
Error: CLANG_WARNING: [#def227]
libfabric-1.12.1/prov/util/src/util_wait.c:470:3: warning[unix.Malloc]: Use of memory after it is freed
# 468| fastlock_acquire(&wait->util_wait.lock);
# 469| while (!dlist_empty(&wait->fd_list)) {
# 470|-> dlist_pop_front(&wait->fd_list, struct ofi_wait_fd_entry,
# 471| fd_entry, entry);
# 472| ofi_wait_fdset_del(wait, fd_entry->fd);
This issue is stale because it has been open 360 days with no activity. Remove stale label or comment, otherwise it will be closed in 7 days.