[PATCH] exit signals: use of uninitialized field notify_count

From: Steve VanDeBogart
Date: Tue Aug 26 2008 - 18:47:52 EST


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.

Signed-off-by: Steve VanDeBogart <vandebo-lkml@xxxxxxxxxxx>
---

Index: linux/kernel/exit.c
===================================================================
--- linux.orig/kernel/exit.c 2008-08-06 09:19:01.000000000 -0700
+++ linux/kernel/exit.c 2008-08-23 15:21:34.000000000 -0700
@@ -883,8 +883,8 @@

/* mt-exec, de_thread() is waiting for us */
if (thread_group_leader(tsk) &&
- tsk->signal->notify_count < 0 &&
- tsk->signal->group_exit_task)
+ tsk->signal->group_exit_task &&
+ tsk->signal->notify_count < 0)
wake_up_process(tsk->signal->group_exit_task);

write_unlock_irq(&tasklist_lock);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/