perf: Limit perf_event_attr::sample_period to 63 bits
[pandora-kernel.git] / kernel / events / core.c
index 7123284..1d1ec64 100644 (file)
@@ -7029,6 +7029,9 @@ SYSCALL_DEFINE5(perf_event_open,
        if (attr.freq) {
                if (attr.sample_freq > sysctl_perf_event_sample_rate)
                        return -EINVAL;
+       } else {
+               if (attr.sample_period & (1ULL << 63))
+                       return -EINVAL;
        }
 
        /*