The following issues were found
drivers/net/ethernet/natsemi/macsonic.c
1 issues
Line: 109
Column: 46
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 reversing the PROM address
*/
static inline void bit_reverse_addr(unsigned char addr[6])
{
int i;
for(i = 0; i < 6; i++)
addr[i] = bitrev8(addr[i]);
Reported by FlawFinder.
drivers/net/ethernet/myricom/myri10ge/myri10ge_mcp_gen_header.h
1 issues
Line: 19
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
/* the first 4 fields are filled at compile time */
unsigned header_length;
__be32 mcp_type;
char version[128];
unsigned mcp_private; /* pointer to mcp-type specific structure */
/* filled by the MCP at run-time */
unsigned sram_size;
unsigned string_specs; /* either the original STRING_SPECS or a superset */
Reported by FlawFinder.
drivers/net/ethernet/mscc/ocelot_vsc7514.c
1 issues
Line: 955
Column: 3
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 regmap *target;
struct resource *res;
struct phy *serdes;
char res_name[8];
if (of_property_read_u32(portnp, "reg", ®))
continue;
port = reg;
Reported by FlawFinder.
drivers/net/wireless/broadcom/b43/leds.c
1 issues
Line: 152
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
bool activelow)
{
struct ieee80211_hw *hw = dev->wl->hw;
char name[B43_LED_MAX_NAME_LEN + 1];
/* Map the b43 specific LED behaviour value to the
* generic LED triggers. */
switch (behaviour) {
case B43_LED_INACTIVE:
Reported by FlawFinder.
drivers/net/wireless/broadcom/b43/leds.h
1 issues
Line: 27
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
* bit is switched off. */
bool activelow;
/* The unique name string for this LED device. */
char name[B43_LED_MAX_NAME_LEN + 1];
/* The current status of the LED. This is updated locklessly. */
atomic_t state;
/* The active state in hardware. */
bool hw_state;
};
Reported by FlawFinder.
drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
1 issues
Line: 177
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct sparx5 *sparx5 = sparx5_port->sparx5;
ppid->id_len = sizeof(sparx5->base_mac);
memcpy(&ppid->id, &sparx5->base_mac, ppid->id_len);
return 0;
}
static const struct net_device_ops sparx5_port_netdev_ops = {
Reported by FlawFinder.
drivers/net/ethernet/microchip/sparx5/sparx5_main.c
1 issues
Line: 567
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
static int sparx5_start(struct sparx5 *sparx5)
{
u8 broadcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
char queue_name[32];
u32 idx;
int err;
/* Setup own UPSIDs */
for (idx = 0; idx < 3; idx++) {
Reported by FlawFinder.
drivers/net/ethernet/microchip/encx24j600.c
1 issues
Line: 764
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!is_valid_ether_addr(address->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
return encx24j600_set_hw_macaddr(dev);
}
static int encx24j600_open(struct net_device *dev)
{
Reported by FlawFinder.
drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c
1 issues
Line: 109
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
mh->key.actions = (void *)mh + sizeof(*mh);
memcpy(mh->key.actions, key.actions, actions_size);
mh->key.num_actions = num_actions;
refcount_set(&mh->refcnt, 1);
init_completion(&mh->res_ready);
hash_add(tbl->hlist, &mh->mod_hdr_hlist, hash_key);
Reported by FlawFinder.
drivers/net/wireless/broadcom/b43/tables_nphy.c
1 issues
Line: 3277
static inline void assert_ntab_array_sizes(void)
{
#undef check
#define check(table, size) \
BUILD_BUG_ON(ARRAY_SIZE(b43_ntab_##table) != B43_NTAB_##size##_SIZE)
check(adjustpower0, C0_ADJPLT);
check(adjustpower1, C1_ADJPLT);
check(bdi, BDI);
Reported by Cppcheck.