lkml.org 
[lkml]   [2008]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] exit signals: use of uninitialized field notify_count
On Wed, 27 Aug 2008, Oleg Nesterov wrote:

>> * Steve VanDeBogart <vandebo-lkml@NerdBox.Net> wrote:
>>
>>> task->signal->notify_count is only initialized if
>>> task->signal->group_exit_task is not NULL. Reorder a conditional so
>>> that uninitialised memory is not used. Found by Valgrind.
>
> Minor comment. As Roland pointed out, it makes sense to initialize
> the whole signal_struct explicitely, perhaps copy_signal() should
> just use zalloc. In that case we don't need to check ->group_exit_task
> at all, the same for __exit_signal().
>
> Thanks Steve! and what do you think about the above?

It looks like that would work. Seems that
sig->count == 0 && sig->group_exit_task != NULL can never be true.
If it does work, a lot of initialization in copy_signal() can be
removed and it would reduce the chances that a similar problem would be
reintroduced. I would submit a patch, but I'm not sure how to trigger
those code paths in order to test it.

--
Steve


\
 
 \ /
  Last update: 2008-08-28 03:01    [W:0.072 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site