linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] pidfd fixes
@ 2019-07-30 19:04 Christian Brauner
  2019-07-30 20:40 ` pr-tracker-bot
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Brauner @ 2019-07-30 19:04 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, oleg, joel

Hi Linus,

This makes setting the exit_state in exit_notify() consistent after fixing
the pidfd polling race pre-rc1. Related to the race fix, this adds a
WARN_ON() to do_notify_pidfd() to catch any future exit_state races.
Last, this removes an obsolete comment from the pidfd tests.

The following changes since commit 609488bc979f99f805f34e9a32c1e3b71179d10b:

  Linux 5.3-rc2 (2019-07-28 12:47:02 -0700)

are available in the Git repository at:

  git@gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux tags/for-linus-20190730

for you to fetch changes up to 30b692d3b390c6fe78a5064be0c4bbd44a41be59:

  exit: make setting exit_state consistent (2019-07-30 19:57:14 +0200)

Please consider pulling from the signed for-linus-20190730 tag.

Thanks!
Christian

----------------------------------------------------------------
for-linus-20190730

----------------------------------------------------------------
Christian Brauner (2):
      pidfd: remove obsolete comments from test
      exit: make setting exit_state consistent

Joel Fernandes (Google) (1):
      pidfd: Add warning if exit_state is 0 during notification

 kernel/exit.c                              | 5 +++--
 kernel/signal.c                            | 1 +
 tools/testing/selftests/pidfd/pidfd_test.c | 6 +-----
 3 files changed, 5 insertions(+), 7 deletions(-)

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [GIT PULL] pidfd fixes
@ 2019-07-22 14:22 Christian Brauner
  2019-07-22 16:27 ` Linus Torvalds
  2019-07-22 16:40 ` pr-tracker-bot
  0 siblings, 2 replies; 8+ messages in thread
From: Christian Brauner @ 2019-07-22 14:22 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, oleg, surenb, joel

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(+)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-07-30 20:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 19:04 [GIT PULL] pidfd fixes Christian Brauner
2019-07-30 20:40 ` pr-tracker-bot
  -- strict thread matches above, loose matches on Subject: below --
2019-07-22 14:22 Christian Brauner
2019-07-22 16:27 ` 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

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).