The following issues were found
arch/mips/kernel/vpe-cmp.c
1 issues
Line: 45
Column: 9
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
{
struct vpe *vpe = get_vpe(aprp_cpu_index());
return sprintf(buf, "%d\n", vpe->ntcs);
}
static ssize_t ntcs_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t len)
{
Reported by FlawFinder.
arch/mips/kernel/uprobes.c
1 issues
Line: 235
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* Initialize the slot */
kaddr = (unsigned long)kmap_atomic(page);
kstart = kaddr + (vaddr & ~PAGE_MASK);
memcpy((void *)kstart, src, len);
flush_icache_range(kstart, kstart + len);
kunmap_atomic((void *)kaddr);
}
/**
Reported by FlawFinder.
arch/mips/kernel/smp-bmips.c
1 issues
Line: 463
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
static void bmips_wr_vec(unsigned long dst, char *start, char *end)
{
memcpy((void *)dst, start, end - start);
dma_cache_wback(dst, end - start);
local_flush_icache_range(dst, dst + (end - start));
instruction_hazard();
}
Reported by FlawFinder.
arch/mips/kernel/rtlx.c
1 issues
Line: 221
Column: 39
CWE codes:
120
20
% chan->buffer_size;
}
static inline int write_spacefree(int read, int write, int size)
{
if (read == write) {
/*
* Never fill the buffer completely, so indexes are always
* equal if empty and only empty, or !equal if data available
Reported by FlawFinder.
arch/s390/lib/spinlock.c
1 issues
Line: 81
CWE codes:
908
ALTERNATIVE("", ".long 0xb2fa0040", 49) /* NIAI 4 */
" l %0,%1\n"
: "=d" (owner) : "Q" (*lock) : "memory");
return owner;
}
static inline int arch_cmpxchg_niai8(int *lock, int old, int new)
{
int expected = old;
Reported by Cppcheck.
arch/mips/kernel/prom.c
1 issues
Line: 22
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
#include <asm/page.h>
#include <asm/prom.h>
static char mips_machine_name[64] = "Unknown";
__init void mips_set_machine_name(const char *name)
{
if (name == NULL)
return;
Reported by FlawFinder.
arch/arm/include/asm/vfpmacros.h
1 issues
Line: 30
Column: 4
CWE codes:
120
20
.endm
#endif
@ read all the working registers back into the VFP
.macro VFPFLDMIA, base, tmp
.fpu vfpv2
#if __LINUX_ARM_ARCH__ < 6
fldmiax \base!, {d0-d15}
#else
Reported by FlawFinder.
arch/mips/kernel/machine_kexec.c
1 issues
Line: 227
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
kexec_indirection_page = (unsigned long)&image->head;
}
memcpy((void*)reboot_code_buffer, relocate_new_kernel,
relocate_new_kernel_size);
/*
* The generic kexec code builds a page list with physical
* addresses. they are directly accessible through KSEG0 (or
Reported by FlawFinder.
arch/mips/kernel/fpu-probe.c
1 issues
Line: 314
static int __init fpu_disable(char *s)
{
cpu_set_nofpu_opts(&boot_cpu_data);
mips_fpu_disabled = 1;
return 1;
}
Reported by Cppcheck.
arch/mips/kernel/crash_dump.c
1 issues
Line: 29
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
vaddr = kmap_local_pfn(pfn);
if (!userbuf) {
memcpy(buf, vaddr + offset, csize);
} else {
if (copy_to_user(buf, vaddr + offset, csize))
csize = -EFAULT;
}
Reported by FlawFinder.