Commit fd1edb3a authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

perf: Fix task_struct reference leak

sys_perf_event_open() had an imbalance in the number of task refs it
took causing memory leakage

Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: stable@kernel.org # .37+
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent ab711fe0
...@@ -6531,6 +6531,11 @@ SYSCALL_DEFINE5(perf_event_open, ...@@ -6531,6 +6531,11 @@ SYSCALL_DEFINE5(perf_event_open,
goto err_alloc; goto err_alloc;
} }
if (task) {
put_task_struct(task);
task = NULL;
}
/* /*
* Look up the group leader (we will attach this event to it): * Look up the group leader (we will attach this event to it):
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment