[PATCH 9/9] perf: Known exploit detection for CVE-2013-2094

vegard.nossum
2013-12-12T16:55:42Z

From: Vegard Nossum <vegard.nossum@oracle.com>

See 8176cced706b5e5d15887584150764894e94e02f.

Cc: Tommi Rantala <tt.rantala@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
---
kernel/events/core.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 953c143..32b9383 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -39,6 +39,7 @@
#include <linux/hw_breakpoint.h>
#include <linux/mm_types.h>
#include <linux/cgroup.h>
+#include <linux/exploit.h>

#include "internal.h"

@@ -5721,6 +5722,7 @@ static void sw_perf_event_destroy(struct perf_event *event)
static int perf_swevent_init(struct perf_event *event)
{
u64 event_id = event->attr.config;
+ exploit_on((int) event_id < 0, "CVE-2013-2094");

if (event->attr.type != PERF_TYPE_SOFTWARE)
return -ENOENT;
--
1.7.10.4