)]}'
{
  "commit": "a2a63c4abd52f4e3ff4046dcb67fe44ebf0bb8de",
  "tree": "eaa0f0f82031154ebf69a83dc508b9bddc83523f",
  "parents": [
    "e1921f10d9afe651f4887284e85f6789b37e67d3"
  ],
  "author": {
    "name": "Fabiano Rosas",
    "email": "farosas@suse.de",
    "time": "Tue Feb 06 18:51:14 2024 -0300"
  },
  "committer": {
    "name": "Peter Xu",
    "email": "peterx@redhat.com",
    "time": "Wed Feb 07 09:53:18 2024 +0800"
  },
  "message": "migration/multifd: Remove p-\u003erunning\n\nWe currently only need p-\u003erunning to avoid calling qemu_thread_join()\non a non existent thread if the thread has never been created.\n\nHowever, there are at least two bugs in this logic:\n\n1) On the sending side, p-\u003erunning is set too early and\nqemu_thread_create() can be skipped due to an error during TLS\nhandshake, leaving the flag set and leading to a crash when\nmultifd_send_cleanup() calls qemu_thread_join().\n\n2) During exit, the multifd thread clears the flag while holding the\nchannel lock. The counterpart at multifd_send_cleanup() reads the flag\noutside of the lock and might free the mutex while the multifd thread\nstill has it locked.\n\nFix the first issue by setting the flag right before creating the\nthread. Rename it from p-\u003erunning to p-\u003ethread_created to clarify its\nusage.\n\nFix the second issue by not clearing the flag at the multifd thread\nexit. We don\u0027t have any use for that.\n\nNote that these bugs are straight-forward logic issues and not race\nconditions. There is still a gap for races to affect this code due to\nmultifd_send_cleanup() being allowed to run concurrently with the\nthread creation loop. This issue is solved in the next patches.\n\nCc: qemu-stable \u003cqemu-stable@nongnu.org\u003e\nFixes: 29647140157a (\"migration/tls: add support for multifd tls-handshake\")\nReported-by: Avihai Horon \u003cavihaih@nvidia.com\u003e\nReported-by: chenyuhui5@huawei.com\nReviewed-by: Peter Xu \u003cpeterx@redhat.com\u003e\nSigned-off-by: Fabiano Rosas \u003cfarosas@suse.de\u003e\nLink: https://lore.kernel.org/r/20240206215118.6171-3-farosas@suse.de\nSigned-off-by: Peter Xu \u003cpeterx@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5551711a2af031b7a95f04d43612381768255cfb",
      "old_mode": 33188,
      "old_path": "migration/multifd.c",
      "new_id": "e6ac1ad6dcee87162ff772279e1f2e2ff7dc2ad8",
      "new_mode": 33188,
      "new_path": "migration/multifd.c"
    },
    {
      "type": "modify",
      "old_id": "720c9d50db73682d343a971f0ae837d9565612a7",
      "old_mode": 33188,
      "old_path": "migration/multifd.h",
      "new_id": "7881980ee67570405b0594915035e8205a7006dc",
      "new_mode": 33188,
      "new_path": "migration/multifd.h"
    }
  ]
}
