)]}'
{
  "commit": "b191d6491be67cef2b3fa83015561caca1394ab9",
  "tree": "6be65f501b18e03aeb3c456f87a36b04dc45043b",
  "parents": [
    "5f9e832c137075045d15cd6899ab0505cfb2ca4b"
  ],
  "author": {
    "name": "Suren Baghdasaryan",
    "email": "surenb@google.com",
    "time": "Wed Jul 17 13:21:00 2019 -0400"
  },
  "committer": {
    "name": "Christian Brauner",
    "email": "christian@brauner.io",
    "time": "Mon Jul 22 16:02:03 2019 +0200"
  },
  "message": "pidfd: fix a poll race when setting exit_state\n\nThere is a race between reading task-\u003eexit_state in pidfd_poll and\nwriting it after do_notify_parent calls do_notify_pidfd. Expected\nsequence of events is:\n\nCPU 0                            CPU 1\n------------------------------------------------\nexit_notify\n  do_notify_parent\n    do_notify_pidfd\n  tsk-\u003eexit_state \u003d EXIT_DEAD\n                                  pidfd_poll\n                                     if (tsk-\u003eexit_state)\n\nHowever nothing prevents the following sequence:\n\nCPU 0                            CPU 1\n------------------------------------------------\nexit_notify\n  do_notify_parent\n    do_notify_pidfd\n                                   pidfd_poll\n                                      if (tsk-\u003eexit_state)\n  tsk-\u003eexit_state \u003d EXIT_DEAD\n\nThis causes a polling task to wait forever, since poll blocks because\nexit_state is 0 and the waiting task is not notified again. A stress\ntest continuously doing pidfd poll and process exits uncovered this bug.\n\nTo fix it, we make sure that the task\u0027s exit_state is always set before\ncalling do_notify_pidfd.\n\nFixes: b53b0b9d9a6 (\"pidfd: add polling support\")\nCc: kernel-team@android.com\nCc: Oleg Nesterov \u003coleg@redhat.com\u003e\nSigned-off-by: Suren Baghdasaryan \u003csurenb@google.com\u003e\nSigned-off-by: Joel Fernandes (Google) \u003cjoel@joelfernandes.org\u003e\nLink: https://lore.kernel.org/r/20190717172100.261204-1-joel@joelfernandes.org\n[christian@brauner.io: adapt commit message and drop unneeded changes from wait_task_zombie]\nSigned-off-by: Christian Brauner \u003cchristian@brauner.io\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a75b6a7f458a7287439e40f0ac102fbb8b61e4a4",
      "old_mode": 33188,
      "old_path": "kernel/exit.c",
      "new_id": "4436158a6d30bfb3ad7ed968e1257fdc19d76bd4",
      "new_mode": 33188,
      "new_path": "kernel/exit.c"
    }
  ]
}
