/* rapl_crash.c -- bug found with perf_fuzzer */ /* by Vince Weaver #include #include #include #include int perf_event_open(struct perf_event_attr *hw_event_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) { return syscall(__NR_perf_event_open,hw_event_uptr, pid, cpu, group_fd, flags); } int main(int argc, char **argv) { int fd; static struct perf_event_attr pe; /* Random Seed was 1421689769 */ /* /proc/sys/kernel/perf_event_max_sample_rate was 100000 */ memset(&pe,0,sizeof(struct perf_event_attr)); pe.type=6; pe.config=0x2ULL; pe.read_format=PERF_FORMAT_TOTAL_TIME_ENABLED|PERF_FORMAT_ID; /* 5 */ pe.pinned=1; pe.config1=0x39ULL; fd=perf_event_open(&pe, -1, /* all processes */ 5, /* Only cpu 5 */ -1, /* no group leader */ PERF_FLAG_FD_NO_GROUP /*1*/ ); close(fd); return 0; }