The following issues were found
tools/perf/util/unwind-libdw.c
1 issues
Line: 73
Column: 3
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
mod = dwfl_report_elf(ui->dwfl, dso->short_name, dso->long_name, -1,
al->map->start - al->map->pgoff, false);
if (!mod) {
char filename[PATH_MAX];
if (dso__build_id_filename(dso, filename, sizeof(filename), false))
mod = dwfl_report_elf(ui->dwfl, dso->short_name, filename, -1,
al->map->start - al->map->pgoff, false);
}
Reported by FlawFinder.
tools/perf/util/zstd.c
1 issues
Line: 79
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (ZSTD_isError(ret)) {
pr_err("failed to compress %ld bytes: %s\n",
(long)src_size, ZSTD_getErrorName(ret));
memcpy(dst, src, src_size);
return src_size;
}
size = output.pos;
size = process_header(record, size);
compressed += size;
Reported by FlawFinder.
tools/power/acpi/common/cmfsize.c
1 issues
Line: 15
#include "acapps.h"
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME("cmfsize")
/*******************************************************************************
*
* FUNCTION: cm_get_file_size
*
Reported by Cppcheck.
tools/include/uapi/linux/in.h
1 issues
Line: 243
Column: 12
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 in_addr sin_addr; /* Internet address */
/* Pad to size of `struct sockaddr'. */
unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
sizeof(unsigned short int) - sizeof(struct in_addr)];
};
#define sin_zero __pad /* for BSD UNIX comp. -FvK */
#endif
Reported by FlawFinder.
tools/include/uapi/linux/fs.h
1 issues
Line: 121
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
__u32 fsx_nextents; /* nextents field value (get) */
__u32 fsx_projid; /* project identifier (get/set) */
__u32 fsx_cowextsize; /* CoW extsize field value (get/set)*/
unsigned char fsx_pad[8];
};
/*
* Flags for the fsx_xflags field
*/
Reported by FlawFinder.
tools/power/cpupower/bench/config.h
1 issues
Line: 19
Column: 17
CWE codes:
134
Suggestion:
Use a constant for the format specification
/* enable further debug messages */
#ifdef DEBUG
#define dprintf printf
#else
#define dprintf(...) do { } while (0)
#endif
Reported by FlawFinder.
tools/power/cpupower/bench/parse.h
1 issues
Line: 19
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
unsigned int cycles; /* calculation cycles with the same sleep/load time */
unsigned int rounds; /* calculation rounds with iterated sleep/load time */
unsigned int cpu; /* cpu for which the affinity is set */
char governor[15]; /* cpufreq governor */
enum sched_prio /* possible scheduler priorities */
{
SCHED_ERR = -1,
SCHED_HIGH,
SCHED_DEFAULT,
Reported by FlawFinder.
tools/include/uapi/drm/drm.h
1 issues
Line: 131
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 drm_hw_lock {
__volatile__ unsigned int lock; /**< lock variable */
char padding[60]; /**< Pad to cache line */
};
/*
* DRM_IOCTL_VERSION ioctl argument type.
*
Reported by FlawFinder.
tools/include/linux/string.h
1 issues
Line: 42
Column: 30
CWE codes:
126
*/
static inline bool strstarts(const char *str, const char *prefix)
{
return strncmp(str, prefix, strlen(prefix)) == 0;
}
extern char * __must_check skip_spaces(const char *);
extern char *strim(char *);
Reported by FlawFinder.
tools/power/cpupower/utils/cpuidle-info.c
1 issues
Line: 144
Column: 9
CWE codes:
120
20
Suggestion:
Check implementation on installation, or limit the size of all string inputs
unsigned int cpu = 0;
do {
ret = getopt_long(argc, argv, "os", info_opts, NULL);
if (ret == -1)
break;
switch (ret) {
case '?':
output_param = '?';
Reported by FlawFinder.