The following issues were found
arch/powerpc/xmon/ppc.h
1 issues
Line: 60
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
/* An array of operand codes. Each code is an index into the
operand table. They appear in the order which the operands must
appear in assembly code, and are terminated by a zero. */
unsigned char operands[8];
};
/* The table itself is sorted by major opcode number, and is otherwise
in the order in which the disassembler should consider
instructions. */
Reported by FlawFinder.
arch/powerpc/xmon/spu-dis.c
1 issues
Line: 108
Column: 6
CWE codes:
134
Suggestion:
Use a constant for the format specification
{
int fb = (insn >> (32-18)) & 0x7f;
if (fb & 0x40)
printf(tag == M_SYNC ? "c" : "p");
if (fb & 0x20)
printf("d");
if (fb & 0x10)
printf("e");
}
Reported by FlawFinder.
arch/nios2/kernel/nios2_ksyms.c
1 issues
Line: 17
Column: 15
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* string functions */
EXPORT_SYMBOL(memcpy);
EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(memmove);
/* memory management */
Reported by FlawFinder.
arch/riscv/errata/sifive/errata.c
1 issues
Line: 15
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
#include <asm/errata_list.h>
struct errata_info_t {
char name[ERRATA_STRING_LENGTH_MAX];
bool (*check_func)(unsigned long arch_id, unsigned long impid);
};
static bool errata_cip_453_check_func(unsigned long arch_id, unsigned long impid)
{
Reported by FlawFinder.
arch/nios2/kernel/cpuinfo.c
1 issues
Line: 52
Column: 3
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
if (str)
strlcpy(cpuinfo.cpu_impl, str, sizeof(cpuinfo.cpu_impl));
else
strcpy(cpuinfo.cpu_impl, "<unknown>");
cpuinfo.has_div = of_property_read_bool(cpu, "altr,has-div");
cpuinfo.has_mul = of_property_read_bool(cpu, "altr,has-mul");
cpuinfo.has_mulx = of_property_read_bool(cpu, "altr,has-mulx");
cpuinfo.has_bmx = of_property_read_bool(cpu, "altr,has-bmx");
Reported by FlawFinder.
arch/arm/mach-davinci/pm.c
1 issues
Line: 40
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
static void davinci_sram_push(void *dest, void *src, unsigned int size)
{
memcpy(dest, src, size);
flush_icache_range((unsigned long)dest, (unsigned long)(dest + size));
}
static void davinci_pm_suspend(void)
{
Reported by FlawFinder.
arch/riscv/include/asm/kexec.h
1 issues
Line: 33
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct pt_regs *oldregs)
{
if (oldregs)
memcpy(newregs, oldregs, sizeof(struct pt_regs));
else
riscv_crash_save_regs(newregs);
}
Reported by FlawFinder.
arch/riscv/include/asm/kgdb.h
1 issues
Line: 108
Column: 14
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 DBG_REG_BADADDR_OFF 34
#define DBG_REG_CAUSE_OFF 35
extern const char riscv_gdb_stub_feature[64];
#define kgdb_arch_gdb_stub_feature riscv_gdb_stub_feature
#endif
#endif
Reported by FlawFinder.
drivers/net/dsa/dsa_loop_bdinfo.c
1 issues
Line: 11
static struct dsa_loop_pdata dsa_loop_pdata = {
.cd = {
.port_names[0] = "lan1",
.port_names[1] = "lan2",
.port_names[2] = "lan3",
.port_names[3] = "lan4",
.port_names[DSA_LOOP_CPU_PORT] = "cpu",
},
Reported by Cppcheck.
drivers/net/dsa/hirschmann/hellcreek.h
1 issues
Line: 258
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 hellcreek_fdb_entry {
size_t idx;
unsigned char mac[ETH_ALEN];
u8 portmask;
u8 age;
u8 is_obt;
u8 pass_blocked;
u8 is_static;
Reported by FlawFinder.