The following issues were found
drivers/net/wan/lapbether.c
1 issues
Line: 304
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
{
struct sockaddr *sa = addr;
memcpy(dev->dev_addr, sa->sa_data, dev->addr_len);
return 0;
}
static const struct lapb_register_struct lapbeth_callbacks = {
.connect_confirmation = lapbeth_connected,
Reported by FlawFinder.
drivers/net/ethernet/ti/cpsw_new.c
1 issues
Line: 1120
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
ppid->id_len = sizeof(cpsw->base_mac);
memcpy(&ppid->id, &cpsw->base_mac, ppid->id_len);
return 0;
}
static const struct net_device_ops cpsw_netdev_ops = {
Reported by FlawFinder.
drivers/net/wan/lmc/lmc_var.h
1 issues
Line: 341
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
char lmc_timing; /* for HSSI and SSI */
int got_irq;
char last_led_err[4];
u32 last_int;
u32 num_int;
spinlock_t lmc_lock;
Reported by FlawFinder.
drivers/net/wan/n2.c
1 issues
Line: 273
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 */
n2_set_iface(port);
return 0;
default:
return hdlc_ioctl(dev, ifr, cmd);
Reported by FlawFinder.
drivers/net/wan/pc300too.c
1 issues
Line: 237
Column: 2
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 */
port->iface = new_type;
pc300_set_iface(port);
return 0;
}
Reported by FlawFinder.
drivers/net/wan/pci200syn.c
1 issues
Line: 214
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 */
pci200_set_iface(port);
sca_flush(port->card);
return 0;
default:
Reported by FlawFinder.
drivers/net/wireless/intel/iwlwifi/mvm/rfi.c
1 issues
Line: 114
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!resp)
return ERR_PTR(-ENOMEM);
memcpy(resp, cmd.resp_pkt->data, resp_size);
iwl_free_resp(&cmd);
return resp;
}
Reported by FlawFinder.
drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
1 issues
Line: 801
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!is_valid_ether_addr(saddr->sa_data))
return -EADDRNOTAVAIL;
memcpy(netdev->dev_addr, saddr->sa_data, netdev->addr_len);
hw_ops->set_mac_address(pdata, netdev->dev_addr);
return 0;
}
Reported by FlawFinder.
drivers/net/wan/wanxl.h
1 issues
Line: 137
Column: 15
CWE codes:
362
typedef struct {
// Card to host
volatile u32 open;
volatile u32 cable;
volatile u32 rx_overruns;
volatile u32 rx_frame_errors;
// Host to card
Reported by FlawFinder.
drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_priv.h
1 issues
Line: 16
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
#include "fs_core.h"
struct mlx5_esw_bridge_fdb_key {
unsigned char addr[ETH_ALEN];
u16 vid;
};
enum {
MLX5_ESW_BRIDGE_FLAG_ADDED_BY_USER = BIT(0),
Reported by FlawFinder.