lkml.org 
[lkml]   [2011]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] taskstats: add_del_listener() should ignore !valid listener's
On Wed, Jul 20, 2011 at 21:00 +0200, Oleg Nesterov wrote:
> When send_cpu_listeners() finds the orphaned listener it marks
> it as !valid and drops listeners->sem. Before it takes this sem
> for wrinting, s->pid can be reused and add_del_listener() can
> wrongly try to re-use this entry.
>
> Change add_del_listener() to check ->valid = T.

I think the current logic is wrong. If s was claimed is invalid, it
then points to a dead task, it is unknown when it died. As the same pid
can be reused by a new process BEFORE add_del_listener(), it is unknown
whether ->pid points to the actual owner task.

Rather than optimizing the wrong algorithm it's better to change the
processes keeping way.

Thanks,

--
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments


\
 
 \ /
  Last update: 2011-07-20 21:49    [W:0.055 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site