public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Adding TIF_TRACE_KERNEL to x86_64
Date: 27 Oct 2007 21:00:31 +0200
Date: Sat, 27 Oct 2007 21:00:31 +0200	[thread overview]
Message-ID: <20071027190031.GA97563@muc.de> (raw)
In-Reply-To: <20071026193738.GA1591@Krystal>

On Fri, Oct 26, 2007 at 03:37:38PM -0400, Mathieu Desnoyers wrote:
> 
> 1 - process A enters in a syscall, TIF_KERNEL_TRACE is cleared
> 2 - we activate TIF_KERNEL_TRACE
> 3 - process A returns from syscall (with wrong top of stack ?) -> segfault.
> 
> Am I on the right track ?

Yes. The code was not designed to allow that. The syscall path
has been optimized to go as fast as possible.

> 
> Can this be a concern with TIF_SYSCALL_TRACE also ? (potential race in
> ptrace ?)

ptrace only changes state in stopped processes; and those are not hanging
in syscalls. So no there is no race in a standard kernel.

If you wanted to change it the right way would be probably to test
for SYSCALL_TRACE too in the work flags and handle it there

-Andi


      parent reply	other threads:[~2007-10-27 19:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26 19:37 Adding TIF_TRACE_KERNEL to x86_64 Mathieu Desnoyers
2007-10-27 18:08 ` [PATCH] Fix x86_64 TIF_SYSCALL_TRACE race in entry.S Mathieu Desnoyers
2007-10-27 19:04   ` Andi Kleen
2007-10-28 21:15     ` Mathieu Desnoyers
2007-10-28 21:21       ` Andi Kleen
2007-10-28 22:31         ` Mathieu Desnoyers
2007-10-27 19:00 ` Andi Kleen [this message]

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=20071027190031.GA97563@muc.de \
    --to=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    /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