The following issues were found
arch/nds32/kernel/nds32_ksyms.c
1 issues
Line: 18
Column: 15
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* mem functions */
EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(memcpy);
EXPORT_SYMBOL(memmove);
EXPORT_SYMBOL(memzero);
/* user mem (segment) */
EXPORT_SYMBOL(__arch_copy_from_user);
Reported by FlawFinder.
arch/s390/crypto/arch_random.c
1 issues
Line: 68
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* try to resolve the requested amount of bytes from the buffer */
arch_rng_buf_idx -= nbytes;
if (arch_rng_buf_idx < ARCH_RNG_BUF_SIZE) {
memcpy(buf, arch_rng_buf + arch_rng_buf_idx, nbytes);
atomic64_add(nbytes, &s390_arch_random_counter);
spin_unlock(&arch_rng_lock);
return true;
}
Reported by FlawFinder.
arch/nds32/include/asm/string.h
1 issues
Line: 8
Column: 14
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
#define __ASM_NDS32_STRING_H
#define __HAVE_ARCH_MEMCPY
extern void *memcpy(void *, const void *, __kernel_size_t);
#define __HAVE_ARCH_MEMMOVE
extern void *memmove(void *, const void *, __kernel_size_t);
#define __HAVE_ARCH_MEMSET
Reported by FlawFinder.
arch/mips/vr41xx/common/siu.c
1 issues
Line: 139
Column: 28
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
if (port.type == PORT_UNKNOWN)
break;
port.mapbase = res[i].start;
port.membase = (unsigned char __iomem *)KSEG1ADDR(res[i].start);
vr41xx_siu_early_setup(&port);
}
}
Reported by FlawFinder.
arch/mips/vdso/genvdso.h
1 issues
Line: 49
Column: 4
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
}
if (strcmp(name, ".mips_abiflags") == 0) {
strcpy(name, ".MIPS.abiflags");
shdr->sh_type = swap_uint32(SHT_MIPS_ABIFLAGS);
shdr->sh_entsize = shdr->sh_size;
}
}
Reported by FlawFinder.
arch/mips/txx9/rbtx4938/setup.c
1 issues
Line: 120
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
static int __init rbtx4938_ethaddr_init(void)
{
#ifdef CONFIG_PCI
unsigned char dat[17];
unsigned char sum;
int i;
/* 0-3: "MAC\0", 4-9:eth0, 10-15:eth1, 16:sum */
if (spi_eeprom_read(SPI_BUSNO, SEEPROM1_CS, 0, dat, sizeof(dat))) {
Reported by FlawFinder.
arch/x86/mm/pti.c
1 issues
Line: 80
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
void __init pti_check_boottime_disable(void)
{
char arg[5];
int ret;
/* Assume mode is auto unless overridden. */
pti_mode = PTI_AUTO;
Reported by FlawFinder.
arch/arm/kernel/smp.c
1 issues
Line: 525
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
}
}
static const char *ipi_types[NR_IPI] __tracepoint_string = {
[IPI_WAKEUP] = "CPU wakeup interrupts",
[IPI_TIMER] = "Timer broadcast interrupts",
[IPI_RESCHEDULE] = "Rescheduling interrupts",
[IPI_CALL_FUNC] = "Function call interrupts",
[IPI_CPU_STOP] = "CPU stop interrupts",
Reported by FlawFinder.
arch/mips/txx9/generic/spi_eeprom.c
1 issues
Line: 36
Column: 2
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
eeprom = kzalloc(sizeof(*eeprom), GFP_KERNEL);
if (!eeprom)
return -ENOMEM;
strcpy(eeprom->name, "at250x0");
eeprom->byte_len = size;
eeprom->page_size = AT250X0_PAGE_SIZE;
eeprom->flags = EE_ADDR1;
info.platform_data = eeprom;
return spi_register_board_info(&info, 1);
Reported by FlawFinder.
arch/mips/tools/loongson3-llsc-check.c
1 issues
Line: 251
Column: 15
CWE codes:
362
}
vmlinux_path = argv[1];
vmlinux_fd = open(vmlinux_path, O_RDONLY);
if (vmlinux_fd == -1) {
perror("Unable to open vmlinux");
goto out_ret;
}
Reported by FlawFinder.