The following issues were found
drivers/net/ethernet/apple/macmace.c
1 issues
Line: 495
Column: 12
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
if (dev->flags & IFF_PROMISC) {
mb->maccc |= PROM;
} else {
unsigned char multicast_filter[8];
struct netdev_hw_addr *ha;
if (dev->flags & IFF_ALLMULTI) {
for (i = 0; i < 8; i++) {
multicast_filter[i] = 0xFF;
Reported by FlawFinder.
drivers/media/dvb-frontends/mxl5xx_defs.h
1 issues
Line: 200
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
cmd_buff[4] = 0x00; \
cmd_buff[5] = 0x00; \
convert_endian(MXL_ENABLE_BIG_ENDIAN, size, (u8 *)data_ptr); \
memcpy((void *)&cmd_buff[6], data_ptr, size); \
} while (0)
struct MXL_REG_FIELD_T {
u32 reg_addr;
u8 lsb_pos;
Reported by FlawFinder.
drivers/net/ethernet/aquantia/atlantic/aq_nic.c
1 issues
Line: 61
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
rss_params = &cfg->aq_rss;
rss_params->hash_secret_key_size = sizeof(rss_key);
memcpy(rss_params->hash_secret_key, rss_key, sizeof(rss_key));
rss_params->indirection_table_size = AQ_CFG_RSS_INDIRECTION_TABLE_MAX;
for (i = rss_params->indirection_table_size; i--;)
rss_params->indirection_table[i] = i & (num_rss_queues - 1);
}
Reported by FlawFinder.
drivers/net/ethernet/aquantia/atlantic/aq_ptp.c
1 issues
Line: 1147
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!info->pin_config)
return;
memcpy(info->pin_config, &pin_desc,
sizeof(struct ptp_pin_desc) * info->n_pins);
}
void aq_ptp_clock_init(struct aq_nic_s *aq_nic)
{
Reported by FlawFinder.
drivers/net/ethernet/aquantia/atlantic/aq_ring.c
1 issues
Line: 436
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
aq_buf_vaddr(&buff->rxdata),
AQ_CFG_RX_HDR_SIZE);
memcpy(__skb_put(skb, hdr_len), aq_buf_vaddr(&buff->rxdata),
ALIGN(hdr_len, sizeof(long)));
if (buff->len - hdr_len > 0) {
skb_add_rx_frag(skb, 0, buff->rxdata.page,
buff->rxdata.pg_off + hdr_len,
Reported by FlawFinder.
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
1 issues
Line: 893
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
cs->dma_oct_rc = hw_atl_stats_rx_dma_good_octet_counter_get(self);
cs->dma_oct_tc = hw_atl_stats_tx_dma_good_octet_counter_get(self);
memcpy(&self->last_stats, &mbox.stats, sizeof(mbox.stats));
return 0;
}
struct aq_stats_s *hw_atl_utils_get_hw_stats(struct aq_hw_s *self)
Reported by FlawFinder.
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
1 issues
Line: 392
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
offsetof(struct hw_atl_utils_fw_rpc, fw2x_offloads);
memset(rpc, 0, rpc_size);
info = &rpc->fw2x_offloads;
memcpy(info->mac_addr, mac, ETH_ALEN);
info->len = sizeof(*info);
err = hw_atl_utils_fw_rpc_call(self, rpc_size);
if (err < 0)
goto err_exit;
Reported by FlawFinder.
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
1 issues
Line: 377
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
hw_atl_stats_tx_dma_good_octet_counter_get(self);
self->curr_stats.dpc = hw_atl_rpb_rx_dma_drop_pkt_cnt_get(self);
memcpy(&priv->last_stats, &stats, sizeof(stats));
return 0;
}
static int aq_a2_fw_get_phy_temp(struct aq_hw_s *self, int *temp)
Reported by FlawFinder.
drivers/net/ethernet/arc/emac_main.c
1 issues
Line: 776
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
arc_emac_set_address_internal(ndev);
return 0;
}
Reported by FlawFinder.
drivers/net/ethernet/atheros/alx/alx.h
1 issues
Line: 100
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 alx_tx_queue *txq;
int vec_idx;
u32 vec_mask;
char irq_lbl[IFNAMSIZ + 8];
};
#define ALX_MAX_NAPIS 8
struct alx_priv {
Reported by FlawFinder.