ofiwg / libfabric

Open Fabric Interfaces
http://libfabric.org/
Other
573 stars 382 forks source link

prov/rxm: convscan report from redhat #6824

Closed shefty closed 2 years ago

shefty commented 3 years ago
Error: CLANG_WARNING: [#def174]
libfabric-1.12.1/prov/rxm/src/rxm_atomic.c:174:2: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
#  172|     atomic_hdr = (struct rxm_atomic_hdr *) tx_buf->pkt.data;
#  173|   
#  174|->   ret = ofi_copy_from_hmem_iov(atomic_hdr->data, buf_len, buf_iface,
#  175|                      buf_device, buf_iov, msg->iov_count, 0);
#  176|     assert(ret == buf_len);

Error: CLANG_WARNING: [#def175]
libfabric-1.12.1/prov/rxm/src/rxm_atomic.c:179:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
#  177|   
#  178|     if (cmp_len) {
#  179|->       ret = ofi_copy_from_hmem_iov(atomic_hdr->data + buf_len,
#  180|                          cmp_len, cmp_iface, cmp_device,
#  181|                          cmp_iov, compare_iov_count, 0);

Error: RESOURCE_LEAK (CWE-772): [#def176] [important]
libfabric-1.12.1/prov/rxm/src/rxm_av.c:144: alloc_arg: "ofi_ip_av_sym_getaddr" allocates memory that is stored into "addr".
libfabric-1.12.1/prov/rxm/src/rxm_av.c:147: leaked_storage: Variable "addr" going out of scope leaks the storage it points to.
#  145|                     svccnt, &addr, &addrlen);
#  146|     if (ret <= 0)
#  147|->       return ret;
#  148|   
#  149|     assert(ret == count);

Error: ATOMICITY (CWE-667): [#def177]
libfabric-1.12.1/prov/rxm/src/rxm_cq.c:1124: lock: Locking "&dom->amo_bufpool_lock".
libfabric-1.12.1/prov/rxm/src/rxm_cq.c:1125: def: Assigning data that might be protected by the lock to "bounce_buf".
libfabric-1.12.1/prov/rxm/src/rxm_cq.c:1126: unlock: Unlocking "&dom->amo_bufpool_lock". "bounce_buf" might now be unreliable because other threads can now change the data that it depends on.
libfabric-1.12.1/prov/rxm/src/rxm_cq.c:1143: unlock: Unlocking "&dev_mr->amo_lock". "bounce_buf" might now be unreliable because other threads can now change the data that it depends on.
libfabric-1.12.1/prov/rxm/src/rxm_cq.c:1145: lockagain: Locking "&dom->amo_bufpool_lock" again.
libfabric-1.12.1/prov/rxm/src/rxm_cq.c:1146: use: Using an unreliable value of "bounce_buf" inside the second locked section. If the data that "bounce_buf" depends on was changed by another thread, this use might be incorrect.
# 1144|   
# 1145|     fastlock_acquire(&dom->amo_bufpool_lock);
# 1146|->   ofi_buf_free(bounce_buf);
# 1147|     fastlock_release(&dom->amo_bufpool_lock);
# 1148|   
github-actions[bot] commented 2 years ago

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.