From: David Mosberger <davidm@hpl.hp.com>
To: Andrea Arcangeli <andrea@suse.de>
Cc: David Mosberger <davidm@hpl.hp.com>, linux-kernel@vger.kernel.org
Subject: Re: [patch] proposed fix for ptrace() SMP race
Date: Thu, 6 Sep 2001 22:21:14 -0700 [thread overview]
Message-ID: <15256.22858.57091.769101@napali.hpl.hp.com> (raw)
In-Reply-To: <20010907032801.N11329@athlon.random>
In-Reply-To: <200109062300.QAA27430@napali.hpl.hp.com> <20010907021900.L11329@athlon.random> <15256.6038.599811.557582@napali.hpl.hp.com> <20010907032801.N11329@athlon.random>
>>>>> On Fri, 7 Sep 2001 03:28:01 +0200, Andrea Arcangeli <andrea@suse.de> said:
Andrea> For making sure the task isn't wakenup while it's under
Andrea> ptrace we should just do that in
Andrea> kernel/signal.c::ignored_signal() as far I can tell.
This doesn't make sense: ignored_signal() is too late as
handle_stop_signal() will already have woken up the task in response
to a SIGCONT. Also, if you're suggesting to ignore SIGCONT while a
PT_PTRACED is set, that certainly wouldn't be right. We only want to
*delay* the wakeup while the ptrace() system call is running (which is
much shorter than the period of time PT_PTRACED is set). So, as far
as I can tell, you'd have to add more locking to the signal path,
which doesn't look attractive to me. Also, if pursuing approach, we'd
have to prove that we cover all possible paths that could wake up the
task. E.g., PTRACE_SYSCALL and PTRACE_CONT are other ways the task
could be woken up. These particular cases should be fine, because
they'll already be serialized by the BKL acquired during ptrace(), but
I'm not so sure there aren't any other cases.
So, I still think cpus_allowed is a safer and better approach at least
for 2.4. Yes, we'd have to add locking for writing cpus_allowed, but
I'd say that makes sense anyhow given that it is being manipulated by
other tasks.
Hmmh, looking at ptrace() more closely, the entire locking situation
seems to be a bit confused. For example, what's stopping wait4() from
releasing the task structure just after ptrace() released the
tasklist_lock and before it checked child->state?
--david
next prev parent reply other threads:[~2001-09-07 5:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-06 23:00 David Mosberger
2001-09-07 0:19 ` Andrea Arcangeli
2001-09-07 0:40 ` David Mosberger
2001-09-07 1:28 ` Andrea Arcangeli
2001-09-07 1:41 ` Alan Cox
2001-09-07 13:34 ` Andrea Arcangeli
2001-09-07 5:21 ` David Mosberger [this message]
2001-09-07 13:28 ` Andrea Arcangeli
2001-09-07 15:35 ` David Mosberger
2001-09-08 17:11 ` Andrea Arcangeli
2001-09-10 17:20 ` David Mosberger
2001-09-10 17:54 Manfred Spraul
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=15256.22858.57091.769101@napali.hpl.hp.com \
--to=davidm@hpl.hp.com \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.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®