The following issues were found
arch/alpha/kernel/irq.c
1 issues
Line: 42
Column: 8
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
}
#ifdef CONFIG_SMP
static char irq_user_affinity[NR_IRQS];
int irq_select_affinity(unsigned int irq)
{
struct irq_data *data = irq_get_irq_data(irq);
struct irq_chip *chip;
Reported by FlawFinder.
arch/s390/appldata/appldata_base.c
1 issues
Line: 52
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
/*
* /proc entries (sysctl)
*/
static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
static int appldata_timer_handler(struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos);
static int appldata_interval_handler(struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos);
Reported by FlawFinder.
arch/nios2/include/asm/cpuinfo.h
1 issues
Line: 13
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 cpuinfo {
/* Core CPU configuration */
char cpu_impl[12];
u32 cpu_clock_freq;
bool mmu;
bool has_div;
bool has_mul;
bool has_mulx;
Reported by FlawFinder.
block/partitions/sgi.c
1 issues
Line: 46
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
Sector sect;
struct sgi_disklabel *label;
struct sgi_partition *p;
char b[BDEVNAME_SIZE];
label = read_part_sector(state, 0, §);
if (!label)
return -1;
p = &label->partitions[0];
Reported by FlawFinder.
arch/nds32/mm/mm-nds32.c
1 issues
Line: 31
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
init_pgd = pgd_offset_k(0);
memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR,
(PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t));
cpu_dcache_wb_range((unsigned long)new_pgd,
(unsigned long)new_pgd +
PTRS_PER_PGD * sizeof(pgd_t));
Reported by FlawFinder.
arch/arm/mach-davinci/board-dm646x-evm.c
1 issues
Line: 259
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
{
int status;
int i;
char label[10];
for (i = 0; i < 4; ++i) {
snprintf(label, 10, "user_sw%d", i);
status = gpio_request(gpio, label);
if (status)
Reported by FlawFinder.
arch/nds32/math-emu/fpuemu.c
1 issues
Line: 41
Column: 23
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
DEF3OPNEG(fnmadd, d, fmuld, faddd, fnegd);
DEF3OPNEG(fnmsub, d, fmuld, fsubd, fnegd);
static const unsigned char cmptab[8] = {
SF_CEQ,
SF_CEQ,
SF_CLT,
SF_CLT,
SF_CLT | SF_CEQ,
Reported by FlawFinder.
arch/nds32/kernel/vdso.c
1 issues
Line: 76
CWE codes:
570
/* Creat a timer io mapping to get clock cycles counter */
get_timer_node_info();
vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
pr_info("vdso: %ld pages (%ld code @ %p, %ld data @ %p)\n",
vdso_pages + 1, vdso_pages, vdso_start, 1L, vdso_data);
/* Allocate the vDSO pagelist */
vdso_pagelist = kcalloc(vdso_pages, sizeof(struct page *), GFP_KERNEL);
Reported by Cppcheck.
arch/nds32/kernel/process.c
1 issues
Line: 228
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
fpvalid = tsk_used_math(tsk);
if (fpvalid) {
lose_fpu();
memcpy(fpu, &tsk->thread.fpu, sizeof(*fpu));
}
#endif
return fpvalid;
}
Reported by FlawFinder.
arch/s390/boot/string.c
1 issues
Line: 37
Column: 9
CWE codes:
126
size_t size;
char *end;
size = strlen(s);
if (!size)
return s;
end = s + size - 1;
while (end >= s && isspace(*end))
Reported by FlawFinder.