From: Christian Brauner <christian@brauner.io>
To: torvalds@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, oleg@redhat.com, surenb@google.com,
joel@joelfernandes.org
Subject: [GIT PULL] pidfd fixes
Date: Mon, 22 Jul 2019 16:22:41 +0200 [thread overview]
Message-ID: <20190722142238.16129-1-christian@brauner.io> (raw)
Hi Linus,
This contains a fix for pidfd polling. It ensures that the task's exit
state is visible to all waiters:
The following changes since commit 5f9e832c137075045d15cd6899ab0505cfb2ca4b:
Linus 5.3-rc1 (2019-07-21 14:05:38 -0700)
are available in the Git repository at:
git@gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux tags/for-linus-20190722
for you to fetch changes up to b191d6491be67cef2b3fa83015561caca1394ab9:
pidfd: fix a poll race when setting exit_state (2019-07-22 16:02:03 +0200)
/* Summary */
The pidfd polling code suffered from a race condition. A waiter could be
notified via do_notify_pidfd() without the task's exit state being set and
thus not visible to the waiter. This would cause the waiter to be blocked
indefinitely. The following schematic illustrates how this could happen:
CPU 0 CPU 1
------------------------------------------------
exit_notify
do_notify_parent
do_notify_pidfd
pidfd_poll
if (tsk->exit_state)
tsk->exit_state = EXIT_DEAD
This is fixed by ensuring that the task's exit state is set before calling
into do_notify_pidfd().
Please consider pulling from the signed for-linus-20190722 tag.
Thanks!
Christian
----------------------------------------------------------------
for-linus-20190722
----------------------------------------------------------------
Suren Baghdasaryan (1):
pidfd: fix a poll race when setting exit_state
kernel/exit.c | 1 +
1 file changed, 1 insertion(+)
next reply other threads:[~2019-07-22 14:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 14:22 Christian Brauner [this message]
2019-07-22 16:27 ` [GIT PULL] pidfd fixes Linus Torvalds
2019-07-22 16:39 ` Christian Brauner
2019-07-23 10:12 ` Oleg Nesterov
2019-07-23 10:25 ` Christian Brauner
2019-07-22 16:40 ` pr-tracker-bot
2019-07-30 19:04 Christian Brauner
2019-07-30 20:40 ` pr-tracker-bot
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=20190722142238.16129-1-christian@brauner.io \
--to=christian@brauner.io \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=surenb@google.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;
as well as URLs for NNTP newsgroup(s).