The following issues were found
drivers/net/ethernet/google/gve/gve_adminq.c
1 issues
Line: 345
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
cmd = &priv->adminq[priv->adminq_prod_cnt & priv->adminq_mask];
priv->adminq_prod_cnt++;
memcpy(cmd, cmd_orig, sizeof(*cmd_orig));
opcode = be32_to_cpu(READ_ONCE(cmd->opcode));
switch (opcode) {
case GVE_ADMINQ_DESCRIBE_DEVICE:
priv->adminq_describe_device_cnt++;
Reported by FlawFinder.
drivers/net/wireless/intel/iwlwifi/mvm/coex.c
1 issues
Line: 483
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (iwl_mvm_send_cmd_pdu(mvm, BT_COEX_CI, 0,
sizeof(cmd), &cmd))
IWL_ERR(mvm, "Failed to send BT_CI cmd\n");
memcpy(&mvm->last_bt_ci_cmd, &cmd, sizeof(cmd));
}
}
void iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm,
struct iwl_rx_cmd_buffer *rxb)
Reported by FlawFinder.
drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c
1 issues
Line: 210
Column: 2
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
unsigned int offset,
bool *activity)
{
char ptce2_pl[MLXSW_REG_PTCE2_LEN];
int err;
mlxsw_reg_ptce2_pack(ptce2_pl, true, MLXSW_REG_PTCE2_OP_QUERY_CLEAR_ON_READ,
_region->tcam_region_info, offset, 0);
err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl);
Reported by FlawFinder.
drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
1 issues
Line: 44
Column: 2
CWE codes:
134
Suggestion:
Make format string constant
struct rvu_devlink *rvu_dl = rvu->rvu_dl;
int rc;
sprintf(&rvu->irq_name[offset * NAME_SIZE], name);
rc = request_irq(pci_irq_vector(rvu->pdev, offset), fn, 0,
&rvu->irq_name[offset * NAME_SIZE], rvu_dl);
if (rc)
dev_warn(rvu->dev, "Failed to register %s irq\n", name);
else
Reported by FlawFinder.
drivers/net/ethernet/mellanox/mlxsw/i2c.c
1 issues
Line: 338
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
mlxsw_i2c->block_size : in_mbox_size;
write_tran.len = MLXSW_I2C_ADDR_WIDTH + chunk_size;
mlxsw_i2c_set_slave_addr(tran_buf, off);
memcpy(&tran_buf[MLXSW_I2C_ADDR_BUF_SIZE], in_mbox +
mlxsw_i2c->block_size * i, chunk_size);
j = 0;
end = jiffies + timeout;
do {
Reported by FlawFinder.
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
1 issues
Line: 613
Column: 2
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
{
struct ixgbe_fcoe_ddp_pool *ddp_pool;
struct dma_pool *pool;
char pool_name[32];
snprintf(pool_name, 32, "ixgbe_fcoe_ddp_%u", cpu);
pool = dma_pool_create(pool_name, dev, IXGBE_FCPTR_MAX,
IXGBE_FCPTR_ALIGN, PAGE_SIZE);
Reported by FlawFinder.
drivers/net/ethernet/mellanox/mlx5/core/wq.h
1 issues
Line: 172
Column: 10
CWE codes:
126
Suggestion:
This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it
int equal = (cc1 == cc2);
int smaller = 0x8000 & (cc1 - cc2);
return !equal && !smaller;
}
static inline u16 mlx5_wq_cyc_get_counter(struct mlx5_wq_cyc *wq)
{
return wq->wqe_ctr;
Reported by FlawFinder.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c
1 issues
Line: 63
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (NULL == dcmd_buf)
return -ENOMEM;
memcpy(dcmd_buf, (void *)cmdhdr + cmdhdr->offset, len);
*(char *)(dcmd_buf + len) = '\0';
}
if (cmdhdr->set)
ret = brcmf_fil_cmd_data_set(ifp, cmdhdr->cmd, dcmd_buf,
Reported by FlawFinder.
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
1 issues
Line: 1020
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
memcpy(&rsp->fwdata, &rvu->fwdata->cgx_fw_data[cgx_id][lmac_id],
sizeof(struct cgx_lmac_fwdata_s));
return 0;
}
int rvu_mbox_handler_cgx_set_link_mode(struct rvu *rvu,
Reported by FlawFinder.
drivers/net/ethernet/mellanox/mlx5/core/diag/en_tc_tracepoint.c
1 issues
Line: 19
Column: 14
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
#define NAME_SIZE 16
static const char FLOWACT2STR[NUM_FLOW_ACTIONS][NAME_SIZE] = {
[FLOW_ACTION_ACCEPT] = "ACCEPT",
[FLOW_ACTION_DROP] = "DROP",
[FLOW_ACTION_TRAP] = "TRAP",
[FLOW_ACTION_GOTO] = "GOTO",
[FLOW_ACTION_REDIRECT] = "REDIRECT",
Reported by FlawFinder.