Skip to content

Commit

Permalink
[S390] oprofile s390: prevent stack corruption
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Glauber authored and Martin Schwidefsky committed Apr 4, 2011
1 parent 78fca1b commit 65a94b1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions arch/s390/oprofile/hwsampler.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,8 @@ static int stop_sampling(int cpu)

static int check_hardware_prerequisites(void)
{
unsigned long long facility_bits[2];

memcpy(facility_bits, S390_lowcore.stfle_fac_list, 32);
if (!(facility_bits[1] & (1ULL << 59)))
if (!test_facility(68))
return -EOPNOTSUPP;

return 0;
}
/*
Expand Down

0 comments on commit 65a94b1

Please sign in to comment.