The following issues were found
net/ipv4/ip_vti.c
2 issues
Line: 428
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct ip_tunnel *tunnel = netdev_priv(dev);
struct iphdr *iph = &tunnel->parms.iph;
memcpy(dev->dev_addr, &iph->saddr, 4);
memcpy(dev->broadcast, &iph->daddr, 4);
dev->flags = IFF_NOARP;
dev->addr_len = 4;
dev->features |= NETIF_F_LLTX;
Reported by FlawFinder.
Line: 429
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct iphdr *iph = &tunnel->parms.iph;
memcpy(dev->dev_addr, &iph->saddr, 4);
memcpy(dev->broadcast, &iph->daddr, 4);
dev->flags = IFF_NOARP;
dev->addr_len = 4;
dev->features |= NETIF_F_LLTX;
netif_keep_dst(dev);
Reported by FlawFinder.
include/uapi/linux/pg.h
2 issues
Line: 53
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 func; /* PG_RESET or PG_COMMAND */
int dlen; /* number of bytes expected to transfer */
int timeout; /* number of seconds before timeout */
char packet[12]; /* packet command */
};
struct pg_read_hdr {
Reported by FlawFinder.
Line: 63
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 scsi; /* "scsi" status == sense key */
int dlen; /* size of device transfer request */
int duration; /* time in seconds command took */
char pad[12]; /* not used */
};
#endif /* _UAPI_LINUX_PG_H */
Reported by FlawFinder.
net/ipv4/ipip.c
2 issues
Line: 383
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
{
struct ip_tunnel *tunnel = netdev_priv(dev);
memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
tunnel->tun_hlen = 0;
tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen;
return ip_tunnel_init(dev);
Reported by FlawFinder.
Line: 384
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct ip_tunnel *tunnel = netdev_priv(dev);
memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
tunnel->tun_hlen = 0;
tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen;
return ip_tunnel_init(dev);
}
Reported by FlawFinder.
include/trace/events/thermal_power_allocator.h
2 issues
Line: 33
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
),
TP_fast_assign(
__entry->tz_id = tz->id;
memcpy(__get_dynamic_array(req_power), req_power,
num_actors * sizeof(*req_power));
__entry->total_req_power = total_req_power;
memcpy(__get_dynamic_array(granted_power), granted_power,
num_actors * sizeof(*granted_power));
__entry->total_granted_power = total_granted_power;
Reported by FlawFinder.
Line: 36
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
memcpy(__get_dynamic_array(req_power), req_power,
num_actors * sizeof(*req_power));
__entry->total_req_power = total_req_power;
memcpy(__get_dynamic_array(granted_power), granted_power,
num_actors * sizeof(*granted_power));
__entry->total_granted_power = total_granted_power;
__entry->num_actors = num_actors;
__entry->power_range = power_range;
__entry->max_allocatable_power = max_allocatable_power;
Reported by FlawFinder.
kernel/power/suspend.c
2 issues
Line: 41
Column: 7
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
[PM_SUSPEND_STANDBY] = "standby",
[PM_SUSPEND_MEM] = "mem",
};
const char *pm_states[PM_SUSPEND_MAX];
static const char * const mem_sleep_labels[] = {
[PM_SUSPEND_TO_IDLE] = "s2idle",
[PM_SUSPEND_STANDBY] = "shallow",
[PM_SUSPEND_MEM] = "deep",
};
Reported by FlawFinder.
Line: 47
Column: 7
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
[PM_SUSPEND_STANDBY] = "shallow",
[PM_SUSPEND_MEM] = "deep",
};
const char *mem_sleep_states[PM_SUSPEND_MAX];
suspend_state_t mem_sleep_current = PM_SUSPEND_TO_IDLE;
suspend_state_t mem_sleep_default = PM_SUSPEND_MAX;
suspend_state_t pm_suspend_target_state;
EXPORT_SYMBOL_GPL(pm_suspend_target_state);
Reported by FlawFinder.
include/uapi/linux/elf.h
2 issues
Line: 206
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
#define EI_NIDENT 16
typedef struct elf32_hdr{
unsigned char e_ident[EI_NIDENT];
Elf32_Half e_type;
Elf32_Half e_machine;
Elf32_Word e_version;
Elf32_Addr e_entry; /* Entry point */
Elf32_Off e_phoff;
Reported by FlawFinder.
Line: 223
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
} Elf32_Ehdr;
typedef struct elf64_hdr {
unsigned char e_ident[EI_NIDENT]; /* ELF "magic number" */
Elf64_Half e_type;
Elf64_Half e_machine;
Elf64_Word e_version;
Elf64_Addr e_entry; /* Entry point virtual address */
Elf64_Off e_phoff; /* Program header table file offset */
Reported by FlawFinder.
include/net/slhc_vj.h
2 issues
Line: 134
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 cstate *next; /* next in ring (xmit) */
struct iphdr cs_ip; /* ip/tcp hdr from most recent packet */
struct tcphdr cs_tcp;
unsigned char cs_ipopt[64];
unsigned char cs_tcpopt[64];
int cs_hsize;
};
#define NULLSLSTATE (struct cstate *)0
Reported by FlawFinder.
Line: 135
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 iphdr cs_ip; /* ip/tcp hdr from most recent packet */
struct tcphdr cs_tcp;
unsigned char cs_ipopt[64];
unsigned char cs_tcpopt[64];
int cs_hsize;
};
#define NULLSLSTATE (struct cstate *)0
/*
Reported by FlawFinder.
include/net/seg6_hmac.h
2 issues
Line: 30
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 rcu_head rcu;
u32 hmackeyid;
char secret[SEG6_HMAC_SECRET_LEN];
u8 slen;
u8 alg_id;
};
struct seg6_hmac_algo {
Reported by FlawFinder.
Line: 37
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 seg6_hmac_algo {
u8 alg_id;
char name[64];
struct crypto_shash * __percpu *tfms;
struct shash_desc * __percpu *shashs;
};
extern int seg6_hmac_compute(struct seg6_hmac_info *hinfo,
Reported by FlawFinder.
lib/zstd/zstd_opt.h
2 issues
Line: 694
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* Last Literals */
{
size_t const lastLLSize = iend - anchor;
memcpy(seqStorePtr->lit, anchor, lastLLSize);
seqStorePtr->lit += lastLLSize;
}
}
FORCE_INLINE
Reported by FlawFinder.
Line: 1009
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* Last Literals */
{
size_t lastLLSize = iend - anchor;
memcpy(seqStorePtr->lit, anchor, lastLLSize);
seqStorePtr->lit += lastLLSize;
}
}
#endif /* ZSTD_OPT_H_91842398743 */
Reported by FlawFinder.
net/bluetooth/hci_conn.c
2 issues
Line: 244
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
cpu_to_le16(0x8000);
}
memcpy(conn->dev_class, ie->data.dev_class, 3);
}
cp.pkt_type = cpu_to_le16(conn->pkt_type);
if (lmp_rswitch_capable(hdev) && !(hdev->link_mode & HCI_LM_MASTER))
cp.role_switch = 0x01;
Reported by FlawFinder.
Line: 411
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
cp.handle = cpu_to_le16(conn->handle);
cp.rand = rand;
cp.ediv = ediv;
memcpy(cp.ltk, ltk, key_size);
hci_send_cmd(hdev, HCI_OP_LE_START_ENC, sizeof(cp), &cp);
}
/* Device _must_ be locked */
Reported by FlawFinder.