mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Alexey Dobriyan <adobriyan@sw.ru>, Kees Cook <kees@ubuntu.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Scott James Remnant <scott@ubuntu.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] wait_task_stopped: tidy up the noreap case
Date: Fri, 16 Nov 2007 12:24:03 -0800 (PST)	[thread overview]
Message-ID: <20071116202403.1CF0C26F8BA@magilla.localdomain> (raw)
In-Reply-To: Oleg Nesterov's message of  Friday, 16 November 2007 20:24:13 +0300 <20071116172413.GA7296@tv-sign.ru>

This is good, but not quite enough.  The original intent behind having the
test was never to return mismatched stale/fresh data.  (Not that it ever
really worked as intended.)  That is, it's fine if the task has woken up
and done other things while WNOWAIT reports it as stopped--that's stale
data, but it just means the waitid call happened "before" the resumption.
However, it should not report anything that could not possibly have been
true before the resumption.  i.e. a changed exit_code, which now means an
normal termination status or a death signal, not the stop signal.  This
also applies to the uid, in case the thread called setuid upon resuming
(and even to ptracedness, not that that one really matters).  (It doesn't
matter for rusage, since that's not really an exact change of state with
reliable ordering anyway.)

So the setting of uid and why should also move before read_unlock.
While you're at it, you could fix the status argument to wait_noreap_copyout.
It should be just exit_code, not the WIFSTOPPED bit format it does now.


Thanks,
Roland

  reply	other threads:[~2007-11-16 20:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-16 17:24 Oleg Nesterov
2007-11-16 20:24 ` Roland McGrath [this message]
2007-11-17 16:38   ` Oleg Nesterov
2007-11-18  9:14     ` Scott James Remnant

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=20071116202403.1CF0C26F8BA@magilla.localdomain \
    --to=roland@redhat.com \
    --cc=adobriyan@sw.ru \
    --cc=akpm@linux-foundation.org \
    --cc=kees@ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=scott@ubuntu.com \
    --cc=torvalds@linux-foundation.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®