lkml.org 
[lkml]   [2008]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] coredump: zap_threads() must skip kernel threads
On Sun, 1 Jun 2008 19:30:45 +0400
Oleg Nesterov <oleg@tv-sign.ru> wrote:

> The main loop in zap_threads() must skip kthreads which may use the same mm.
> Otherwise we "kill" this thread erroneously (for example, it can not fork or
> exec after that), and the coredumping task stucks in the TASK_UNINTERRUPTIBLE
> state forever because of the wrong ->core_waiters count.
>
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
>
> --- 26-rc2/fs/exec.c~3_CD_FIX_RACE_USE_MM 2008-05-31 20:05:21.000000000 +0400
> +++ 26-rc2/fs/exec.c 2008-06-01 19:04:39.000000000 +0400
> @@ -1568,11 +1568,13 @@ static inline int zap_threads(struct tas
> for_each_process(g) {
> if (g == tsk->group_leader)
> continue;
> + if (g->flags & PF_KTHREAD)
> + continue;
>
> p = g;
> do {
> if (p->mm) {
> - if (p->mm == mm) {
> + if (unlikely(p->mm == mm)) {
> lock_task_sighand(p, &flags);
> zap_process(p);
> unlock_task_sighand(p, &flags);

This is a bugfix, yes?

How does it get triggered?

Do you think the bug is sufficiently serious to fix it in 2.6.26? In
2.6.25.x? If so, it would be better if this patch were not dependent
upon the preceding ones, which do not appear to be 2.6.26 or -stable
material.



\
 
 \ /
  Last update: 2008-06-03 23:19    [W:0.095 / U:27.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site