The following issues were found
drivers/net/wireguard/allowedips.c
1 issues
Line: 31
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
#endif
node->bit_at_b = 7U - (cidr % 8U);
node->bitlen = bits;
memcpy(node->bits, src, bits / 8U);
}
static inline u8 choose(struct allowedips_node *node, const u8 *key)
{
return (key[node->bit_at_a] >> node->bit_at_b) & 1;
Reported by FlawFinder.
drivers/net/wireless/intel/iwlegacy/4965-calib.c
1 issues
Line: 422
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
/* Copy table for comparison next time */
memcpy(&(il->sensitivity_tbl[0]), &(cmd.table[0]),
sizeof(u16) * HD_TBL_SIZE);
return il_send_cmd(il, &cmd_out);
}
Reported by FlawFinder.
drivers/net/ethernet/freescale/fec_mpc52xx.c
1 issues
Line: 115
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
{
struct sockaddr *sock = addr;
memcpy(dev->dev_addr, sock->sa_data, dev->addr_len);
mpc52xx_fec_set_paddr(dev, sock->sa_data);
return 0;
}
Reported by FlawFinder.
drivers/net/ethernet/freescale/fec.h
1 issues
Line: 490
Column: 11
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 fec_enet_priv_tx_q {
struct bufdesc_prop bd;
unsigned char *tx_bounce[TX_RING_SIZE];
struct sk_buff *tx_skbuff[TX_RING_SIZE];
unsigned short tx_stop_threshold;
unsigned short tx_wake_threshold;
Reported by FlawFinder.
drivers/net/ethernet/sun/sunqe.c
1 issues
Line: 847
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!dev)
return -ENOMEM;
memcpy(dev->dev_addr, idprom->id_ethaddr, ETH_ALEN);
qe = netdev_priv(dev);
res = -ENODEV;
Reported by FlawFinder.
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
1 issues
Line: 1842
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 ice_aqc_get_pkg_info {
struct ice_pkg_ver ver;
char name[ICE_SEG_NAME_SIZE];
__le32 track_id;
u8 is_in_nvm;
u8 is_active;
u8 is_active_at_boot;
u8 is_modified;
Reported by FlawFinder.
drivers/net/ethernet/sun/ldmvsw.c
1 issues
Line: 246
Column: 2
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
dev->perm_addr[i] = dev->dev_addr[i];
}
sprintf(dev->name, "vif%d.%d", (int)handle, (int)port_id);
dev->netdev_ops = &vsw_ops;
dev->ethtool_ops = &vsw_ethtool_ops;
dev->watchdog_timeo = VSW_TX_TIMEOUT;
Reported by FlawFinder.
drivers/net/ethernet/intel/ice/ice_common.h
1 issues
Line: 33
Column: 31
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
enum ice_status ice_update_link_info(struct ice_port_info *pi);
enum ice_status
ice_acquire_res(struct ice_hw *hw, enum ice_aq_res_ids res,
enum ice_aq_res_access_type access, u32 timeout);
void ice_release_res(struct ice_hw *hw, enum ice_aq_res_ids res);
enum ice_status
ice_alloc_hw_res(struct ice_hw *hw, u16 type, u16 num, bool btm, u16 *res);
enum ice_status
ice_free_hw_res(struct ice_hw *hw, u16 type, u16 num, u16 *res);
Reported by FlawFinder.
drivers/net/ethernet/socionext/netsec.c
1 issues
Line: 391
Column: 69
CWE codes:
120
20
MAC_REG_CMD, NETSEC_GMAC_CMD_ST_BUSY);
}
static int netsec_mac_read(struct netsec_priv *priv, u32 addr, u32 *read)
{
int ret;
netsec_write(priv, MAC_REG_CMD, addr | NETSEC_GMAC_CMD_ST_READ);
ret = netsec_wait_while_busy(priv,
Reported by FlawFinder.
drivers/net/wireless/ath/ath10k/ce.c
1 issues
Line: 605
CWE codes:
908
sdesc.nbytes = __cpu_to_le16(nbytes);
sdesc.flags = __cpu_to_le16(desc_flags);
*desc = sdesc;
src_ring->per_transfer_context[write_index] = per_transfer_context;
/* Update Source Ring Write Index */
write_index = CE_RING_IDX_INCR(nentries_mask, write_index);
Reported by Cppcheck.