The following issues were found
drivers/net/usb/sr9700.c
1 issues
Line: 299
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return -EINVAL;
}
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
sr_write_async(dev, SR_PAR, 6, netdev->dev_addr);
return 0;
}
Reported by FlawFinder.
drivers/net/ethernet/wiznet/w5100.h
1 issues
Line: 18
Column: 8
CWE codes:
120
20
struct w5100_ops {
bool may_sleep;
int chip_id;
int (*read)(struct net_device *ndev, u32 addr);
int (*write)(struct net_device *ndev, u32 addr, u8 data);
int (*read16)(struct net_device *ndev, u32 addr);
int (*write16)(struct net_device *ndev, u32 addr, u16 data);
int (*readbulk)(struct net_device *ndev, u32 addr, u8 *buf, int len);
int (*writebulk)(struct net_device *ndev, u32 addr, const u8 *buf,
Reported by FlawFinder.
drivers/net/ethernet/emulex/benet/be_roce.h
1 issues
Line: 52
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
/* ocrdma driver register's the callback functions with nic driver. */
struct ocrdma_driver {
unsigned char name[32];
u32 be_abi_version;
struct ocrdma_dev *(*add) (struct be_dev_info *dev_info);
void (*remove) (struct ocrdma_dev *);
void (*state_change_handler) (struct ocrdma_dev *, u32 new_state);
};
Reported by FlawFinder.
drivers/net/ethernet/via/via-velocity.h
1 issues
Line: 1471
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (in_dev != NULL) {
ifa = rcu_dereference(in_dev->ifa_list);
if (ifa != NULL) {
memcpy(vptr->ip_addr, &ifa->ifa_address, 4);
res = 0;
}
}
rcu_read_unlock();
return res;
Reported by FlawFinder.
drivers/net/ethernet/intel/e1000e/ptp.c
1 issues
Line: 104
Column: 35
CWE codes:
78
Suggestion:
try using a library call that implements the same functionality if available
* clock values in ns.
**/
static int e1000e_phc_get_syncdevicetime(ktime_t *device,
struct system_counterval_t *system,
void *ctx)
{
struct e1000_adapter *adapter = (struct e1000_adapter *)ctx;
struct e1000_hw *hw = &adapter->hw;
unsigned long flags;
Reported by FlawFinder.
drivers/net/ethernet/via/via-rhine.c
1 issues
Line: 450
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
dma_addr_t tx_skbuff_dma[TX_RING_SIZE];
/* Tx bounce buffers (Rhine-I only) */
unsigned char *tx_buf[TX_RING_SIZE];
unsigned char *tx_bufs;
dma_addr_t tx_bufs_dma;
int irq;
long pioaddr;
Reported by FlawFinder.
drivers/net/vmxnet3/vmxnet3_ethtool.c
1 issues
Line: 35
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
#define VXLAN_UDP_PORT 8472
struct vmxnet3_stat_desc {
char desc[ETH_GSTRING_LEN];
int offset;
};
/* per tq stats maintained by the device */
Reported by FlawFinder.
drivers/net/ethernet/tundra/tsi108_eth.c
1 issues
Line: 1146
Column: 33
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
for (i = 0; i < 6; i++)
/* +2 is for the offset of the HW addr type */
dev->dev_addr[i] = ((unsigned char *)addr)[i + 2];
word2 = (dev->dev_addr[0] << 16) | (dev->dev_addr[1] << 24);
word1 = (dev->dev_addr[2] << 0) | (dev->dev_addr[3] << 8) |
(dev->dev_addr[4] << 16) | (dev->dev_addr[5] << 24);
Reported by FlawFinder.
drivers/net/ethernet/freescale/fman/mac.c
1 issues
Line: 105
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
params->base_addr = (typeof(params->base_addr))
devm_ioremap(priv->dev, mac_dev->res->start,
resource_size(mac_dev->res));
memcpy(¶ms->addr, mac_dev->addr, sizeof(mac_dev->addr));
params->max_speed = priv->max_speed;
params->phy_if = mac_dev->phy_if;
params->basex_if = false;
params->mac_id = priv->cell_index;
params->fm = (void *)priv->fman;
Reported by FlawFinder.
drivers/net/wan/c101.c
1 issues
Line: 259
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (new_line.loopback != 0 && new_line.loopback != 1)
return -EINVAL;
memcpy(&port->settings, &new_line, size); /* Update settings */
c101_set_iface(port);
return 0;
default:
return hdlc_ioctl(dev, ifr, cmd);
Reported by FlawFinder.