)]}'
{
  "commit": "7027d1145436a58cdbd79a22d60e2a95c4ba333f",
  "tree": "10fc93c508956114299938d55a44dc6e1c0d857c",
  "parents": [
    "18cdca7d07e053b2dfbe26fb0d18fec85713759f"
  ],
  "author": {
    "name": "William A. Kennington III",
    "email": "wak@google.com",
    "time": "Tue Sep 22 02:29:31 2026 +0000"
  },
  "committer": {
    "name": "mdb:gbmc-git-owners",
    "email": "superproject-auto-update@invalid",
    "time": "Wed Sep 23 23:05:48 2026 -0700"
  },
  "message": "peci: core: prevent sysfs new_device race during peci_del_adapter\n\nWhen peci_del_adapter() tears down an adapter while a userspace daemon\nsuch as intel-cpusensor is actively polling, the daemon sees the client\ndevices (e.g. 0-30, 0-31) disappear during device_for_each_child() and\nimmediately writes to /sys/bus/peci/devices/peci-0/new_device to\nre-instantiate them.\n\nBecause peci_sysfs_new_device() called peci_new_device() outside\nadapter-\u003euserspace_clients_lock, a racing new_device write could\nregister a new child onto adapter-\u003edev after both userspace_clients and\ndevice_for_each_child() had already completed, right before adapter-\u003edev\nwas unregistered and freed.\n\nFix this by:\n1. Adding an is_registered flag to struct peci_adapter, set on successful\n   adapter registration and checked/cleared under\n   adapter-\u003euserspace_clients_lock at the start of peci_del_adapter().\n   Checking is_registered before teardown also prevents concurrent or\n   re-entrant double device_unregister().\n2. Holding adapter-\u003euserspace_clients_lock across the registration check,\n   peci_new_device(), and list_add_tail() in peci_sysfs_new_device(), so\n   racing new_device writes are immediately rejected once teardown begins.\n3. Deferring idr_remove() until after device_unregister() completes,\n   preventing premature bus number reuse and sysfs name collisions.\n4. Adding dev_info() traces in peci_del_adapter() and\n   peci_sysfs_new_device() to confirm clean teardown and rejection of\n   late instantiations.\n\nGoogle-Bug-Id: 540863271\nChange-Id: I8873cd4bb6c068c63ff00f1c6f0411af16915463\nSigned-off-by: William A. Kennington III \u003cwak@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "695443f526f13912598c8f4c91e4f94512ec8d33",
      "old_mode": 57344,
      "old_path": "linux/5.15",
      "new_id": "599bb66b4cde45f6454d2b265ec5faa5f92e4e9a",
      "new_mode": 57344,
      "new_path": "linux/5.15"
    }
  ]
}
