From: Alan Cox <alan@redhat.com>
To: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
Cc: solar@openwall.dot.com, Alan Cox <alan@redhat.com>,
Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
linux-kernel@vger.kernel.org
Subject: Re: question about /proc/<PID>/mem in 2.4
Date: Wed, 7 Jul 2004 12:13:29 -0400 [thread overview]
Message-ID: <20040707161329.GI31674@devserv.devel.redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0407071444300.26475-100000@localhost.localdomain>
On Wed, Jul 07, 2004 at 02:53:44PM +0100, Tigran Aivazian wrote:
> if (!MAY_PTRACE(task) || !may_ptrace_attach(task))
> return -ESRCH;
>
> Btw, the second check looks like an obvious race to me. I.e. if this
> condition can change between the check in the beginning of mem_read() and
> return from access_process_vm() then what is to stop it from changing just
> after this second check and return from mem_read()?
The boundary in question is exec(). We don't allow ptrace attach during
an exec in process and that may well make the specific mm untraceable.
So the lifetime is something like
exec
no attach
create mm
load stuff
destroy old mm
if suid
no ptrace
can attach (maybe)
So an open by self before an exec always refers to the old dead mm and
the one after always hits the other checks. A user can ptrace their own
app but ptrace itself doesn't set ptraced exec's setuid.
prev parent reply other threads:[~2004-07-07 16:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-05 13:27 question about /proc/<PID>/mem in 2.4 Tigran Aivazian
2004-07-05 13:37 ` FabF
2004-07-05 14:22 ` Tigran Aivazian
2004-07-05 14:25 ` FabF
2004-07-06 11:14 ` Tigran Aivazian
2004-07-06 10:49 ` Arjan van de Ven
2004-07-06 11:35 ` Tigran Aivazian
2004-07-06 11:04 ` Marcelo Tosatti
2004-07-06 13:08 ` Tigran Aivazian
2004-07-06 16:31 ` Alan Cox
2004-07-07 13:53 ` Tigran Aivazian
2004-07-07 13:26 ` Tigran Aivazian
2004-07-07 16:21 ` Daniel Jacobowitz
2004-07-07 16:13 ` Alan Cox [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=20040707161329.GI31674@devserv.devel.redhat.com \
--to=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.tosatti@cyclades.com \
--cc=solar@openwall.dot.com \
--cc=tigran@aivazian.fsnet.co.uk \
/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