summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorJan Glauber <jang@linux.vnet.ibm.com>2011-04-04 09:43:29 +0200
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2011-04-04 09:43:32 +0200
commit65a94b1417badaee2ed923fd07e23b651b25c729 (patch)
treede16ca3f8edc0f54dbe621ea754bdbd5d4a9bb97 /arch/s390
parent78fca1b95837a44983608302e89c7258981be9b3 (diff)
downloadblackbird-op-linux-65a94b1417badaee2ed923fd07e23b651b25c729.tar.gz
blackbird-op-linux-65a94b1417badaee2ed923fd07e23b651b25c729.zip
[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>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/oprofile/hwsampler.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c
index 3d48f4db246d..4952872d6f0a 100644
--- a/arch/s390/oprofile/hwsampler.c
+++ b/arch/s390/oprofile/hwsampler.c
@@ -517,12 +517,8 @@ stop_exit:
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;
}
/*
OpenPOWER on IntegriCloud