From: Petr Tesarik <ptesarik@suse.cz>
To: Luming Yu <luming.yu@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-ia64@vger.kernel.org, Roland McGrath <roland@redhat.com>
Subject: Re: [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a
Date: Thu, 22 May 2008 08:47:25 +0000 [thread overview]
Message-ID: <1211446045.5610.33.camel@elijah.suse.cz> (raw)
In-Reply-To: <3877989d0805211947i54bacc7cv619541e9b40824fb@mail.gmail.com>
On Thu, 2008-05-22 at 10:47 +0800, Luming Yu wrote:
> Hello list,
>
> The following patch is to fixed a race in ptrace_stop handling which
> causes "strace" hang if the target process blocks SIGTRAP with the
> test case filed at
> https://bugzilla.redhat.com/show_bug.cgi?idD6200#c16.
> Please note this is just IA64 problem because just IA64 has
> arch_ptrace_stop_needed defined, and has arch_ptrace_stop defined that
> would set notify_resume flags for syncing rbs...but it also opens the
> door to invoke ia64_do_signal->get_signal_to_deliver before setting
> current PTRACED flag. Please help review.
>
> **The patch is enclosed in text attachment*
> **I'm using web client to send the patch* *
I'm inlining the patch for sake of convenience:
>
> Signed-off-by: Yu Luming <luming.yu@intel.com>
> --------------------------------------
> signal.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> --- 0/kernel/signal.c 2008-05-14 02:24:51.000000000 +0800
> +++ 1/kernel/signal.c 2008-05-22 13:54:42.000000000 +0800
> @@ -1488,6 +1488,9 @@
> {
> int killed = 0;
>
> + /* Let the debugger run. */
> + __set_current_state(TASK_TRACED);
> +
That's probably not what we want. What happens if the task then sleeps
during the user-space access? Unless I forgot something obvious, it will
never get scheduled again...
Petr Tesarik
> if (arch_ptrace_stop_needed(exit_code, info)) {
> /*
> * The arch code has something special to do before a
> @@ -1516,8 +1519,6 @@
> current->last_siginfo = info;
> current->exit_code = exit_code;
>
> - /* Let the debugger run. */
> - __set_current_state(TASK_TRACED);
> spin_unlock_irq(¤t->sighand->siglock);
> read_lock(&tasklist_lock);
> if (!unlikely(killed) && may_ptrace_stop()) {
next prev parent reply other threads:[~2008-05-22 8:47 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-22 2:47 [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a race Luming Yu
2008-05-22 8:47 ` Petr Tesarik [this message]
2008-05-22 9:16 ` Luming Yu
2008-05-22 11:18 ` Roland McGrath
2008-05-22 12:12 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a Petr Tesarik
2008-05-22 20:39 ` Roland McGrath
2008-05-23 12:33 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a race Luming Yu
2008-05-22 13:24 ` Luming Yu
2008-05-22 20:34 ` Roland McGrath
2008-05-23 3:42 ` Luming Yu
2008-05-23 4:19 ` Roland McGrath
2008-05-23 5:24 ` Luming Yu
2008-05-26 0:15 ` Roland McGrath
2008-05-26 1:30 ` Luming Yu
2008-05-27 3:31 ` Luming Yu
2008-05-27 4:04 ` Roland McGrath
2008-05-27 5:49 ` Luming Yu
2008-05-27 6:12 ` Roland McGrath
2008-05-27 6:25 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a Petr Tesarik
2008-06-03 6:04 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a race Luming Yu
2008-06-03 9:01 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a Petr Tesarik
2008-06-03 14:32 ` Petr Tesarik
2008-06-03 21:01 ` Roland McGrath
2008-06-03 21:31 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a race Luck, Tony
2008-06-03 22:13 ` Roland McGrath
2008-06-10 8:23 ` Luming Yu
2008-06-04 2:16 ` Luming Yu
2008-06-04 9:16 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a Petr Tesarik
2008-06-05 1:49 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a race Luming Yu
2008-06-05 11:16 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a Petr Tesarik
2008-06-06 0:07 ` Roland McGrath
2008-09-09 3:06 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a race Luming Yu
2008-09-10 5:55 ` Roland McGrath
2008-09-16 8:50 ` Luming Yu
2008-09-17 17:01 ` Roland McGrath
2008-09-18 5:44 ` Luming Yu
2008-05-27 6:34 ` Luming Yu
2008-05-27 8:48 ` Luming Yu
2008-05-28 9:14 ` Luming Yu
2008-06-03 6:02 ` Luming Yu
2008-05-30 8:05 ` Roland McGrath
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=1211446045.5610.33.camel@elijah.suse.cz \
--to=ptesarik@suse.cz \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luming.yu@gmail.com \
--cc=roland@redhat.com \
/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