public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: "Luming Yu" <luming.yu@gmail.com>
To: Petr Tesarik <ptesarik@suse.cz>
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 race
Date: Thu, 22 May 2008 09:16:28 +0000	[thread overview]
Message-ID: <3877989d0805220216o5add20ddye2a1fde98a0c1e69@mail.gmail.com> (raw)
In-Reply-To: <1211446045.5610.33.camel@elijah.suse.cz>

On Thu, May 22, 2008 at 4:47 PM, Petr Tesarik <ptesarik@suse.cz> wrote:
> 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:
>

thanks.

>>
>> 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...

My intention is to disable signal delivering before TASK_TRACED flag
is set for correctly handling ptrace_stop() with SIGTRAP masked.
Although this patch totally is a hack, but it should clearly shows
where the problem is that I want to solve..

>
> 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(&current->sighand->siglock);
>>       read_lock(&tasklist_lock);
>>       if (!unlikely(killed) && may_ptrace_stop()) {
>
>

  reply	other threads:[~2008-05-22  9:16 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 ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a Petr Tesarik
2008-05-22  9:16   ` Luming Yu [this message]
2008-05-22 11:18     ` [RFC PATCH] set TASK_TRACED before arch_ptrace code to fix a race 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=3877989d0805220216o5add20ddye2a1fde98a0c1e69@mail.gmail.com \
    --to=luming.yu@gmail.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ptesarik@suse.cz \
    --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