From: Andrew Morton <akpm@osdl.org>
To: rusty@rustcorp.com.au, jeremy@redfishsoftware.com.au,
linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: [PATCH] Fix signal race during process exit
Date: Wed, 2 Jun 2004 00:16:53 -0700 [thread overview]
Message-ID: <20040602001653.738887b2.akpm@osdl.org> (raw)
In-Reply-To: <20040602000812.541ee72a.akpm@osdl.org>
Andrew Morton <akpm@osdl.org> wrote:
>
> yes?
no. It needs tasklist_lock as well, to keep the other CPU (which is doing
wait4) at bay.
Fix a race identified by Jeremy Kerr <jeremy@redfishsoftware.com.au>: if
update_process_times() decides to deliver a signal due to process timer
expiry, it can race with __exit_sighand()'s freeing of task->sighand.
Fix that by clearing the per-process timer state in exit_notify(), while under
local_irq_disable() and under tasklist_lock. tasklist_lock provides exclusion
wrt release_task()'s freeing of task->sighand and local_irq_disable() provides
exclusion wrt update_process_times()'s inspection of the per-process timer
state.
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
25-akpm/kernel/exit.c | 7 +++++++
1 files changed, 7 insertions(+)
diff -puN kernel/exit.c~really-fix-signal-race-during-process-exit kernel/exit.c
--- 25/kernel/exit.c~really-fix-signal-race-during-process-exit 2004-06-02 00:09:01.491659584 -0700
+++ 25-akpm/kernel/exit.c 2004-06-02 00:15:31.230410288 -0700
@@ -737,6 +737,13 @@ static void exit_notify(struct task_stru
tsk->flags |= PF_DEAD;
/*
+ * Clear these here so that update_process_times() won't try to deliver
+ * itimer signals to this task while it is in late exit.
+ */
+ tsk->it_virt_incr = 0;
+ tsk->it_prof_value = 0;
+
+ /*
* In the preemption case it must be impossible for the task
* to get runnable again, so use "_raw_" unlock to keep
* preempt_count elevated until we schedule().
_
next prev parent reply other threads:[~2004-06-02 7:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-02 2:13 Jeremy Kerr
2004-06-02 5:57 ` Andrew Morton
2004-06-02 6:49 ` Rusty Russell
2004-06-02 7:08 ` Andrew Morton
2004-06-02 7:16 ` Andrew Morton [this message]
2004-06-02 8:13 ` Jeremy Kerr
2004-06-04 1:21 Roland McGrath
2004-06-04 1:30 ` Andrew Morton
2004-06-10 1:48 ` Roland McGrath
2004-06-10 2:20 ` Andrew Morton
2004-06-10 2:51 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040602001653.738887b2.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=jeremy@redfishsoftware.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®