From: Chris Wright <chrisw@osdl.org>
To: Roland McGrath <roland@redhat.com>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fix PTRACE_ATTACH race with real parent's wait calls
Date: Fri, 24 Sep 2004 16:32:10 -0700 [thread overview]
Message-ID: <20040924163210.X1973@build.pdx.osdl.net> (raw)
In-Reply-To: <200409242312.i8ONCJ6w004680@magilla.sf.frob.com>; from roland@redhat.com on Fri, Sep 24, 2004 at 04:12:19PM -0700
* Roland McGrath (roland@redhat.com) wrote:
> There is a race between PTRACE_ATTACH and the real parent calling wait.
> For a moment, the task is put in PT_PTRACED but with its parent still
> pointing to its real_parent. In this circumstance, if the real parent
> calls wait without the WUNTRACED flag, he can see a stopped child status,
> which wait should never return without WUNTRACED when the caller is not
> using ptrace. Here it is not the caller that is using ptrace, but some
> third party.
>
> This patch avoids this race condition by only setting PT_PTRACED while
> holding the tasklist_lock.
>
> ptrace_attach used task_lock for this, and a comment in sched.h says that
> it covers ->ptrace. But in fact, no other users of ->ptrace use task_lock
> for synchronization. The places that clear ->ptrace all do so while
Well, checking for setuid during exec does. I wonder if this opens a
race (again, this area is always touchy). /me looks deeper
thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
next prev parent reply other threads:[~2004-09-24 23:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-24 23:12 Roland McGrath
2004-09-24 23:32 ` Chris Wright [this message]
2004-09-25 0:51 ` Roland McGrath
2004-09-25 1:39 ` 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=20040924163210.X1973@build.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@redhat.com \
--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®