Skip to content

Commit 65a94b1

Browse files
Jan GlauberMartin Schwidefsky
authored andcommitted
[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: Jan Glauber <jang@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 78fca1b commit 65a94b1

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎arch/s390/oprofile/hwsampler.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,12 +517,8 @@ static int stop_sampling(int cpu)
517517

518518
static int check_hardware_prerequisites(void)
519519
{
520-
unsigned long long facility_bits[2];
521-
522-
memcpy(facility_bits, S390_lowcore.stfle_fac_list, 32);
523-
if (!(facility_bits[1] & (1ULL << 59)))
520+
if (!test_facility(68))
524521
return -EOPNOTSUPP;
525-
526522
return 0;
527523
}
528524
/*

0 commit comments

Comments
 (0)