Commit 65a94b14 authored by Jan Glauber's avatar Jan Glauber Committed by Martin Schwidefsky

[S390] oprofile s390: prevent stack corruption

Prevent stack corruption by memcpy which copies more bytes then
available at the destination. While at it use the new test_facility
to test for the facility bit.
Signed-off-by: default avatarJan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 78fca1b9
...@@ -517,12 +517,8 @@ static int stop_sampling(int cpu) ...@@ -517,12 +517,8 @@ static int stop_sampling(int cpu)
static int check_hardware_prerequisites(void) static int check_hardware_prerequisites(void)
{ {
unsigned long long facility_bits[2]; if (!test_facility(68))
memcpy(facility_bits, S390_lowcore.stfle_fac_list, 32);
if (!(facility_bits[1] & (1ULL << 59)))
return -EOPNOTSUPP; return -EOPNOTSUPP;
return 0; return 0;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment