The following issues were found
tools/testing/kunit/qemu_configs/i386.py
2 issues
Line: 1
Column: 1
from ..qemu_config import QemuArchParams
QEMU_ARCH = QemuArchParams(linux_arch='i386',
kconfig='''
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y''',
qemu_arch='x86_64',
kernel_path='arch/x86/boot/bzImage',
kernel_command_line='console=ttyS0',
Reported by Pylint.
Line: 1
Column: 1
from ..qemu_config import QemuArchParams
QEMU_ARCH = QemuArchParams(linux_arch='i386',
kconfig='''
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y''',
qemu_arch='x86_64',
kernel_path='arch/x86/boot/bzImage',
kernel_command_line='console=ttyS0',
Reported by Pylint.
tools/testing/kunit/qemu_configs/powerpc.py
2 issues
Line: 1
Column: 1
from ..qemu_config import QemuArchParams
QEMU_ARCH = QemuArchParams(linux_arch='powerpc',
kconfig='''
CONFIG_PPC64=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_HVC_CONSOLE=y''',
qemu_arch='ppc64',
Reported by Pylint.
Line: 1
Column: 1
from ..qemu_config import QemuArchParams
QEMU_ARCH = QemuArchParams(linux_arch='powerpc',
kconfig='''
CONFIG_PPC64=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_HVC_CONSOLE=y''',
qemu_arch='ppc64',
Reported by Pylint.
sound/usb/quirks.c
2 issues
Line: 1100
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
dev_info(&dev->dev, "Waiting for MOTU Microbook II to boot up...\n");
/* First we tell the device which sample rate to use. */
memcpy(buf, set_samplerate_seq, sizeof(set_samplerate_seq));
actual_length = sizeof(set_samplerate_seq);
err = snd_usb_motu_microbookii_communicate(dev, buf, MICROBOOK_BUF_SIZE,
&actual_length);
if (err < 0) {
Reported by FlawFinder.
Line: 1122
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
memset(buf, 0, MICROBOOK_BUF_SIZE);
memcpy(buf, poll_ready_seq, sizeof(poll_ready_seq));
actual_length = sizeof(poll_ready_seq);
err = snd_usb_motu_microbookii_communicate(
dev, buf, MICROBOOK_BUF_SIZE, &actual_length);
if (err < 0) {
Reported by FlawFinder.
tools/testing/selftests/powerpc/math/vmx_signal.c
2 issues
Line: 83
Column: 2
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
if (rc)
return p;
srand(pthread_self());
for (i = 0; i < 12; i++)
for (j = 0; j < 4; j++)
varray[i][j] = rand();
rc = preempt_vmx(varray, &threads_starting, &running);
Reported by FlawFinder.
Line: 117
Column: 3
CWE codes:
676
Suggestion:
Use nanosleep(2) or setitimer(2) instead
printf("\tWaiting for %d workers to start... %d", threads, threads_starting);
while (threads_starting) {
asm volatile("": : :"memory");
usleep(1000);
printf(", %d", threads_starting);
}
printf(" ...done\n");
printf("\tSending signals to all threads %d times...", ITERATIONS);
Reported by FlawFinder.
tools/testing/kunit/qemu_configs/s390.py
2 issues
Line: 1
Column: 1
from ..qemu_config import QemuArchParams
QEMU_ARCH = QemuArchParams(linux_arch='s390',
kconfig='''
CONFIG_EXPERT=y
CONFIG_TUNE_ZEC12=y
CONFIG_NUMA=y
CONFIG_MODULES=y''',
qemu_arch='s390x',
Reported by Pylint.
Line: 1
Column: 1
from ..qemu_config import QemuArchParams
QEMU_ARCH = QemuArchParams(linux_arch='s390',
kconfig='''
CONFIG_EXPERT=y
CONFIG_TUNE_ZEC12=y
CONFIG_NUMA=y
CONFIG_MODULES=y''',
qemu_arch='s390x',
Reported by Pylint.
tools/testing/kunit/qemu_configs/sparc.py
2 issues
Line: 1
Column: 1
from ..qemu_config import QemuArchParams
QEMU_ARCH = QemuArchParams(linux_arch='sparc',
kconfig='''
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y''',
qemu_arch='sparc',
kernel_path='arch/sparc/boot/zImage',
kernel_command_line='console=ttyS0 mem=256M',
Reported by Pylint.
Line: 1
Column: 1
from ..qemu_config import QemuArchParams
QEMU_ARCH = QemuArchParams(linux_arch='sparc',
kconfig='''
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y''',
qemu_arch='sparc',
kernel_path='arch/sparc/boot/zImage',
kernel_command_line='console=ttyS0 mem=256M',
Reported by Pylint.
tools/testing/kunit/qemu_configs/x86_64.py
2 issues
Line: 1
Column: 1
from ..qemu_config import QemuArchParams
QEMU_ARCH = QemuArchParams(linux_arch='x86_64',
kconfig='''
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y''',
qemu_arch='x86_64',
kernel_path='arch/x86/boot/bzImage',
kernel_command_line='console=ttyS0',
Reported by Pylint.
Line: 1
Column: 1
from ..qemu_config import QemuArchParams
QEMU_ARCH = QemuArchParams(linux_arch='x86_64',
kconfig='''
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y''',
qemu_arch='x86_64',
kernel_path='arch/x86/boot/bzImage',
kernel_command_line='console=ttyS0',
Reported by Pylint.
tools/testing/selftests/powerpc/tm/tm-unavailable.c
2 issues
Line: 37
#define VSX_UNA_EXCEPTION 2
#define NUM_EXCEPTIONS 3
#define err_at_line(status, errnum, format, ...) \
error_at_line(status, errnum, __FILE__, __LINE__, format ##__VA_ARGS__)
#define pr_warn(code, format, ...) err_at_line(0, code, format, ##__VA_ARGS__)
#define pr_err(code, format, ...) err_at_line(1, code, format, ##__VA_ARGS__)
Reported by Cppcheck.
Line: 274
Column: 4
CWE codes:
134
Suggestion:
Use a constant for the format specification
/* Check VEC (vs32) for the expected value. */
if (high_vs32 != 0x5555555555555555 || low_vs32 != 0xFFFFFFFFFFFFFFFF) {
printf("VEC corrupted!");
printf(" high = %#16" PRIx64 " low = %#16" PRIx64,
high_vs32, low_vs32);
flags.result++;
} else
printf("VEC ok");
Reported by FlawFinder.
tools/testing/selftests/net/socket.c
2 issues
Line: 39
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
static int run_tests(void)
{
char err_string1[ERR_STRING_SZ];
char err_string2[ERR_STRING_SZ];
int i, err;
err = 0;
for (i = 0; i < ARRAY_SIZE(tests); i++) {
Reported by FlawFinder.
Line: 40
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
static int run_tests(void)
{
char err_string1[ERR_STRING_SZ];
char err_string2[ERR_STRING_SZ];
int i, err;
err = 0;
for (i = 0; i < ARRAY_SIZE(tests); i++) {
struct socket_testcase *s = &tests[i];
Reported by FlawFinder.
tools/testing/selftests/net/reuseport_bpf_numa.c
2 issues
Line: 75
Column: 9
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 void attach_bpf(int fd)
{
static char bpf_log_buf[65536];
static const char bpf_license[] = "";
int bpf_fd;
const struct bpf_insn prog[] = {
/* R0 = bpf_get_numa_node_id() */
Reported by FlawFinder.
Line: 165
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 epoll_event ev;
int i, fd;
char buf[8];
i = epoll_wait(epfd, &ev, 1, -1);
if (i < 0)
error(1, errno, "epoll_wait failed");
Reported by FlawFinder.