The following issues were found
tools/perf/arch/powerpc/annotate/instructions.c
1 issues
Line: 21
Column: 6
CWE codes:
126
ops = &jump_ops;
i = strlen(name) - 1;
if (i < 0)
return NULL;
/* ignore optional hints at the end of the instructions */
if (name[i] == '+' || name[i] == '-')
Reported by FlawFinder.
tools/perf/arch/powerpc/util/dwarf-regs.c
1 issues
Line: 67
GPR_DWARFNUM_NAME(29),
GPR_DWARFNUM_NAME(30),
GPR_DWARFNUM_NAME(31),
REG_DWARFNUM_NAME(msr, 66),
REG_DWARFNUM_NAME(ctr, 109),
REG_DWARFNUM_NAME(link, 108),
REG_DWARFNUM_NAME(xer, 101),
REG_DWARFNUM_NAME(dar, 119),
REG_DWARFNUM_NAME(dsisr, 118),
Reported by Cppcheck.
tools/perf/arch/powerpc/util/kvm-stat.c
1 issues
Line: 34
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
};
/* 1 extra placeholder for NULL */
const char *kvm_events_tp[NR_TPS + 1];
const char *kvm_exit_reason;
static void hcall_event_get_key(struct evsel *evsel,
struct perf_sample *sample,
struct event_key *key)
Reported by FlawFinder.
tools/perf/arch/sh/util/dwarf-regs.c
1 issues
Line: 16
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
*/
#define SH_MAX_REGS 18
const char *sh_regs_table[SH_MAX_REGS] = {
"r0",
"r1",
"r2",
"r3",
"r4",
Reported by FlawFinder.
tools/perf/arch/sparc/util/dwarf-regs.c
1 issues
Line: 13
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
#define SPARC_MAX_REGS 96
const char *sparc_regs_table[SPARC_MAX_REGS] = {
"%g0", "%g1", "%g2", "%g3", "%g4", "%g5", "%g6", "%g7",
"%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%sp", "%o7",
"%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7",
"%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%fp", "%i7",
"%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7",
Reported by FlawFinder.
tools/perf/arch/x86/tests/insn-x86-dat-32.c
1 issues
Line: 2209
{{0x0f, 0x01, 0xc5, }, 3, 0, "", "",
"0f 01 c5 \tpconfig ",},
{{0xf3, 0x0f, 0x09, }, 3, 0, "", "",
"f3 0f 09 \twbnoinvd ",},
Reported by Cppcheck.
drivers/greybus/greybus_trace.h
1 issues
Line: 182
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
__entry->hd_bus_id = connection->hd->bus_id;
__entry->bundle_id = connection->bundle ?
connection->bundle->id : BUNDLE_ID_NONE;
memcpy(__get_str(name), connection->name,
sizeof(connection->name));
__entry->state = connection->state;
__entry->flags = connection->flags;
),
Reported by FlawFinder.
drivers/gpu/vga/vga_switcheroo.c
1 issues
Line: 778
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
vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
size_t cnt, loff_t *ppos)
{
char usercmd[64];
int ret;
bool delay = false, can_switch;
bool just_mux = false;
enum vga_switcheroo_client_id client_id = VGA_SWITCHEROO_UNKNOWN_ID;
struct vga_switcheroo_client *client = NULL;
Reported by FlawFinder.
drivers/gpu/host1x/job.c
1 issues
Line: 570
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* Copy the gather */
gather = host1x_bo_mmap(g->bo);
memcpy(job->gather_copy_mapped + offset, gather + g->offset,
g->words * sizeof(u32));
host1x_bo_munmap(g->bo, gather);
/* Store the location in the buffer */
g->base = job->gather_copy;
Reported by FlawFinder.
drivers/gpu/host1x/intr.h
1 issues
Line: 42
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 host1x_syncpt_intr {
spinlock_t lock;
struct list_head wait_head;
char thresh_irq_name[12];
struct work_struct work;
};
struct host1x_waitlist {
struct list_head list;
Reported by FlawFinder.