aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nls/nls_cp874.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2011-01-19 19:22:07 +0100
committerIngo Molnar <mingo@elte.hu>2011-01-19 20:04:27 +0100
commitdbe08d82ce3967ccdf459f7951d02589cf967300 (patch)
tree2f8fc95749e47ff0de4b369f298898e4db5ad391 /fs/nls/nls_cp874.c
parentc56eb8fb6dccb83d9fe62fd4dc00c834de9bc470 (diff)
downloadkernel_replicant_linux-dbe08d82ce3967ccdf459f7951d02589cf967300.tar.gz
kernel_replicant_linux-dbe08d82ce3967ccdf459f7951d02589cf967300.tar.bz2
kernel_replicant_linux-dbe08d82ce3967ccdf459f7951d02589cf967300.zip
perf: Fix find_get_context() vs perf_event_exit_task() race
find_get_context() must not install the new perf_event_context if the task has already passed perf_event_exit_task(). If nothing else, this means the memory leak. Initially ctx->refcount == 2, it is supposed that perf_event_exit_task_context() should participate and do the necessary put_ctx(). find_lively_task_by_vpid() checks PF_EXITING but this buys nothing, by the time we call find_get_context() this task can be already dead. To the point, cmpxchg() can succeed when the task has already done the last schedule(). Change find_get_context() to populate task->perf_event_ctxp[] under task->perf_event_mutex, this way we can trust PF_EXITING because perf_event_exit_task() takes the same mutex. Also, change perf_event_exit_task_context() to use rcu_dereference(). Probably this is not strictly needed, but with or without this change find_get_context() can race with setup_new_exec()->perf_event_exit_task(), rcu_dereference() looks better. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Prasad <prasad@linux.vnet.ibm.com> Cc: Roland McGrath <roland@redhat.com> LKML-Reference: <20110119182207.GB12183@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/nls/nls_cp874.c')
0 files changed, 0 insertions, 0 deletions