The following issues were found
tools/testing/selftests/powerpc/include/pkeys.h
1 issues
Line: 109
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
}
#define pkey_rights(r) ({ \
static char buf[4] = "rwx"; \
unsigned int amr_bits; \
if ((r) & PKEY_DISABLE_EXECUTE) \
buf[2] = '-'; \
amr_bits = (r) & PKEY_BITS_MASK; \
if (amr_bits & PKEY_DISABLE_WRITE) \
Reported by FlawFinder.
tools/testing/selftests/powerpc/math/fpu_preempt.c
1 issues
Line: 45
Column: 2
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
void *preempt_fpu_c(void *p)
{
int i;
srand(pthread_self());
for (i = 0; i < 21; i++)
darray[i] = rand();
/* Test failed if it ever returns */
preempt_fpu(darray, &threads_starting, &running);
Reported by FlawFinder.
tools/testing/selftests/powerpc/math/fpu_signal.c
1 issues
Line: 66
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 < 21; i++)
darray[i] = rand();
rc = preempt_fpu(darray, &threads_starting, &running);
Reported by FlawFinder.
tools/testing/selftests/powerpc/math/vmx_preempt.c
1 issues
Line: 45
Column: 2
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
void *preempt_vmx_c(void *p)
{
int i, j;
srand(pthread_self());
for (i = 0; i < 12; i++)
for (j = 0; j < 4; j++)
varray[i][j] = rand();
/* Test fails if it ever returns */
Reported by FlawFinder.
tools/testing/selftests/powerpc/math/vsx_preempt.c
1 issues
Line: 76
Column: 2
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
{
int i, j;
long rc;
srand(pthread_self());
for (i = 0; i < 12; i++)
for (j = 0; j < 4; j++) {
varray[i][j] = rand();
/* Don't want zero because it hides kernel problems */
if (varray[i][j] == 0)
Reported by FlawFinder.
tools/testing/selftests/powerpc/mm/pkey_siginfo.c
1 issues
Line: 249
Column: 2
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
struct region r;
int ret, i;
srand(time(NULL));
ret = pkeys_unsupported();
if (ret)
return ret;
/* Allocate the region */
Reported by FlawFinder.
tools/testing/selftests/powerpc/mm/prot_sao.c
1 issues
Line: 28
Column: 3
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
*/
SKIP_IF(!have_hwcap(PPC_FEATURE_ARCH_2_06) ||
have_hwcap2(PPC_FEATURE2_ARCH_3_1) ||
access("/proc/device-tree/rtas/ibm,hypertas-functions", F_OK) == 0);
/*
* Ensure we can ask for PROT_SAO.
* We can't really verify that it does the right thing, but at least we
* confirm the kernel will accept it.
Reported by FlawFinder.
tools/testing/selftests/powerpc/mm/subpage_prot.c
1 issues
Line: 197
Column: 7
CWE codes:
362
SKIP_IF(!syscall_available());
fd = open(file_name, O_RDWR);
if (fd == -1) {
perror("failed to open file");
return 1;
}
sigaction(SIGSEGV, &act, NULL);
Reported by FlawFinder.
tools/testing/selftests/powerpc/nx-gzip/include/nxu.h
1 issues
Line: 240
Column: 4
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
};
union {
union nx_qw_t in_dht[DHTSZ]; /* qw[1:18] */
char in_dht_char[DHT_MAXSZ]; /* byte access */
};
union nx_qw_t reserved[5]; /* qw[19:23] */
};
/* CPBOutput */
Reported by FlawFinder.