lkml.org 
[lkml]   [2014]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [perf] more perf_fuzzer memory corruption

OK, with the following patch I've been running the problem test case for
an hour without triggering the bug.

I'm sure this is the wrong fix (maybe patching over the problem istead of
fixing the root cause), but it works for me.

It looks like this whole mess got introduced with 76e1d9047 in Linux
2.6.35 when the swevent code was converted to use a hashed list.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>

diff --git a/kernel/events/core.c b/kernel/events/core.c
index f83a71a..970d711 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5775,6 +5800,11 @@ static void sw_perf_event_destroy(struct perf_event *event)

WARN_ON(event->parent);

+ perf_pmu_disable(event->pmu);
+ if ((event->hlist_entry.pprev) && (event->hlist_entry.pprev!=LIST_POISON2))
+ event->pmu->del(event, 0);
+ perf_pmu_enable(event->pmu);
+
static_key_slow_dec(&perf_swevent_enabled[event_id]);
swevent_hlist_put(event);
}

\
 
 \ /
  Last update: 2014-05-01 23:41    [W:0.157 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site