The following issues were found
tools/power/cpupower/utils/cpupower-info.c
1 issues
Line: 55
Column: 16
CWE codes:
120
20
Suggestion:
Check implementation on installation, or limit the size of all string inputs
textdomain(PACKAGE);
/* parameter parsing */
while ((ret = getopt_long(argc, argv, "b", set_opts, NULL)) != -1) {
switch (ret) {
case 'b':
if (params.perf_bias)
print_wrong_arg_exit();
params.perf_bias = 1;
Reported by FlawFinder.
tools/power/cpupower/utils/helpers/helpers.h
1 issues
Line: 51
Column: 4
CWE codes:
134
Suggestion:
Use a constant for the format specification
#define dprint(fmt, ...) { \
if (be_verbose) { \
fprintf(stderr, "%s: " fmt, \
__func__, ##__VA_ARGS__); \
} \
}
#else
static inline void dprint(const char *fmt, ...) { }
Reported by FlawFinder.
tools/testing/selftests/sync/sync_stress_merge.c
1 issues
Line: 46
Column: 2
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
int fence, tmpfence, merged, valid;
int timeline, timeline_offset, sync_point;
srand(time(NULL));
for (i = 0; i < timeline_count; i++)
timelines[i] = sw_sync_timeline_create();
fence = sw_sync_fence_create(timelines[0], "fence", 0);
Reported by FlawFinder.
tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c
1 issues
Line: 168
Column: 35
CWE codes:
126
current_count[num] = calloc(cpu_count,
sizeof(unsigned long long));
}
intel_hsw_ext_monitor.name_len = strlen(intel_hsw_ext_monitor.name);
return &intel_hsw_ext_monitor;
}
void hsw_ext_unregister(void)
{
Reported by FlawFinder.
tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
1 issues
Line: 357
Column: 27
CWE codes:
126
mperf_current_count = calloc(cpu_count, sizeof(unsigned long long));
aperf_current_count = calloc(cpu_count, sizeof(unsigned long long));
mperf_monitor.name_len = strlen(mperf_monitor.name);
return &mperf_monitor;
}
void mperf_unregister(void)
{
Reported by FlawFinder.
tools/power/cpupower/utils/idle_monitor/nhm_idle.c
1 issues
Line: 188
Column: 31
CWE codes:
126
sizeof(unsigned long long));
}
intel_nhm_monitor.name_len = strlen(intel_nhm_monitor.name);
return &intel_nhm_monitor;
}
void intel_nhm_unregister(void)
{
Reported by FlawFinder.
tools/power/cpupower/utils/idle_monitor/snb_idle.c
1 issues
Line: 173
Column: 31
CWE codes:
126
current_count[num] = calloc(cpu_count,
sizeof(unsigned long long));
}
intel_snb_monitor.name_len = strlen(intel_snb_monitor.name);
return &intel_snb_monitor;
}
void snb_unregister(void)
{
Reported by FlawFinder.
tools/include/asm/bug.h
1 issues
Line: 8
Column: 36
CWE codes:
134
Suggestion:
Use a constant for the format specification
#include <linux/compiler.h>
#include <stdio.h>
#define __WARN_printf(arg...) do { fprintf(stderr, arg); } while (0)
#define WARN(condition, format...) ({ \
int __ret_warn_on = !!(condition); \
if (unlikely(__ret_warn_on)) \
__WARN_printf(format); \
Reported by FlawFinder.
tools/gpio/gpio-hammer.c
1 issues
Line: 137
Column: 14
CWE codes:
120
20
Suggestion:
Check implementation on installation, or limit the size of all string inputs
int i;
i = 0;
while ((c = getopt(argc, argv, "c:n:o:?")) != -1) {
switch (c) {
case 'c':
loops = strtoul(optarg, NULL, 10);
break;
case 'n':
Reported by FlawFinder.
tools/firewire/decode-fcp.c
1 issues
Line: 151
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 avc_frame *) t->request->packet.write_block.data;
const struct avc_opcode_info *info;
const char *name;
char buffer[32];
int i;
info = &opcode_info[frame->opcode];
if (info->name == NULL) {
snprintf(buffer, sizeof(buffer),
Reported by FlawFinder.