)]}'
{
  "commit": "f05bd61a3213613de7848c8df2865492d5225023",
  "tree": "83989bf1bdf8ce6555fa2ad106b872523c4f1064",
  "parents": [
    "674006912777747170ad70d7727804ad4f2d047f"
  ],
  "author": {
    "name": "Cen Zhang",
    "email": "zzzccc427@gmail.com",
    "time": "Thu Oct 22 20:05:56 2026 +0800"
  },
  "committer": {
    "name": "Luiz Augusto von Dentz",
    "email": "luiz.von.dentz@intel.com",
    "time": "Mon Nov 02 17:09:02 2026 -0500"
  },
  "message": "Bluetooth: hci_sync: Protect resolving-list lookups\n\nThe host resolving list is updated under hdev-\u003elock, and each\nbdaddr_list_with_irk entry must remain alive throughout a lookup.\nhci_le_del_resolve_list_sync() and hci_le_add_resolve_list_sync()\ntraverse that list without taking the lock.\n\nOn an LE privacy-capable controller with a programmed entry, passive\nscan reconciliation can reach hci_le_del_resolve_list_sync() while a\nprivileged HCI_RAW client sends LE Clear Resolving List. The raw\ncommand does not take req_lock, and its successful completion runs\non the controller workqueue independently of request work:\n\n  Request work                     Raw HCI / event work\n  hci_le_del_resolve_list_sync()\n    lookup loads a list node\n                                   hci_sock_sendmsg()\n                                     queue LE Clear Resolving List\n                                   hci_cc_le_clear_resolv_list()\n                                     take hdev-\u003elock\n                                     unlink and free the node\n                                     release hdev-\u003elock\n    read the node\u0027s address/type\n\nThe clear can free the node after the lookup loads it and before its\naddress/type read, causing a use-after-free. The report below shows\nthis access with the delete helper on the faulting stack. The add\nhelper uses the same unprotected lookup.\n\nTake hdev-\u003elock around each resolving-list membership lookup and\nretain only a boolean result. This serializes traversal with clear\ncompletion and keeps entry pointers inside the protected section.\nRelease the lock before issuing a synchronous HCI command, whose\ncompletion also needs the lock.\n\nKASAN report as below:\n\n    \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n    BUG: KASAN: slab-use-after-free in\n    hci_bdaddr_list_lookup_with_irk+0x106/0x120\n    Read of size 1 at addr ffff88810b036e16 by task kworker/u17:0/495\n\n    CPU: 2 UID: 0 PID: 495 Comm: kworker/u17:0 Not tainted\n    7.2.0-rc6-pmb-bt-functional-v1+ #3 PREEMPT(lazy)\n    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix,\n    1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014\n    Workqueue: hci0 hci_cmd_sync_work\n    Call Trace:\n     \u003cTASK\u003e\n     dump_stack_lvl+0x93/0xd0\n     print_report+0xce/0x630\n     ? hci_bdaddr_list_lookup_with_irk+0x106/0x120\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? __virt_addr_valid+0x20d/0x410\n     ? hci_bdaddr_list_lookup_with_irk+0x106/0x120\n     kasan_report+0xe0/0x110\n     ? hci_bdaddr_list_lookup_with_irk+0x106/0x120\n     hci_bdaddr_list_lookup_with_irk+0x106/0x120\n     hci_le_del_resolve_list_sync.isra.0+0xd6/0x3f0\n     ? __pfx_hci_le_del_resolve_list_sync.isra.0+0x10/0x10\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     hci_le_del_accept_list_sync.isra.0+0x11c/0x290\n     ? __pfx_hci_le_del_accept_list_sync.isra.0+0x10/0x10\n     ? hci_passive_scan_sync+0x551/0x1e80\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? lock_release+0xc8/0x280\n     hci_passive_scan_sync+0x71c/0x1e80\n     ? __pfx_hci_passive_scan_sync+0x10/0x10\n     ? find_held_lock+0x2b/0x80\n     ? hci_lookup_le_connect+0xe1/0x3c0\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? find_held_lock+0x2b/0x80\n     ? hci_update_passive_scan_sync+0x437/0x950\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? lock_release+0xc8/0x280\n     hci_update_passive_scan_sync+0x461/0x950\n     hci_cmd_sync_work+0x1b3/0x450\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     process_one_work+0x908/0x19c0\n     ? __pfx_process_one_work+0x10/0x10\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? lock_is_held_type+0x8f/0x100\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     worker_thread+0x65c/0xe40\n     ? __pfx_worker_thread+0x10/0x10\n     kthread+0x34f/0x460\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? __pfx_kthread+0x10/0x10\n     ret_from_fork+0x659/0x940\n     ? __pfx_ret_from_fork+0x10/0x10\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? __switch_to+0x74f/0xf80\n     ? __pfx_kthread+0x10/0x10\n     ret_from_fork_asm+0x1a/0x30\n     \u003c/TASK\u003e\n\n    Allocated by task 495:\n     kasan_save_stack+0x33/0x60\n     kasan_save_track+0x14/0x30\n     __kasan_kmalloc+0xaa/0xb0\n     __kmalloc_cache_noprof+0x251/0x610\n     hci_bdaddr_list_add_with_irk+0x183/0x3e0\n     hci_cc_le_add_to_resolv_list+0x18c/0x240\n     hci_cmd_complete_evt+0x373/0xab0\n     hci_event_packet+0x4e8/0xc70\n     hci_rx_work+0x367/0xf00\n     process_one_work+0x908/0x19c0\n     worker_thread+0x65c/0xe40\n     kthread+0x34f/0x460\n     ret_from_fork+0x659/0x940\n     ret_from_fork_asm+0x1a/0x30\n\n    Freed by task 497:\n     kasan_save_stack+0x33/0x60\n     kasan_save_track+0x14/0x30\n     kasan_save_free_info+0x3b/0x60\n     __kasan_slab_free+0x5f/0x80\n     kfree+0x307/0x580\n     hci_bdaddr_list_clear+0x134/0x230\n     hci_cc_le_clear_resolv_list+0x13d/0x240\n     hci_cmd_complete_evt+0x373/0xab0\n     hci_event_packet+0x4e8/0xc70\n     hci_rx_work+0x367/0xf00\n     process_one_work+0x908/0x19c0\n     worker_thread+0x65c/0xe40\n     kthread+0x34f/0x460\n     ret_from_fork+0x659/0x940\n     ret_from_fork_asm+0x1a/0x30\n\n    The buggy address belongs to the object at ffff88810b036e00\n    which belongs to the cache kmalloc-64 of size 64\n    The buggy address is located 22 bytes inside of\n    freed 64-byte region [ffff88810b036e00, ffff88810b036e40)\n\n    The buggy address belongs to the physical page:\n    page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0\n    pfn:0x10b036\n    flags: 0x200000000000000(node\u003d0|zone\u003d2)\n    page_type: f5(slab)\n    raw: 0200000000000000 ffff8881000428c0 dead000000000100\n    dead000000000122\n    raw: 0000000000000000 0000000000200020 00000000f5000000\n    0000000000000000\n    page dumped because: kasan: bad access detected\n\n    Memory state around the buggy address:\n     ffff88810b036d00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc\n     ffff88810b036d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc\n    \u003effff88810b036e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc\n                             ^\n     ffff88810b036e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc\n     ffff88810b036f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc\n    \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n    Disabling lock debugging due to kernel taint\n\nFixes: e8907f76544f (\"Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3\")\nAssisted-by: LLM\nSigned-off-by: Cen Zhang \u003czzzccc427@gmail.com\u003e\nSigned-off-by: Luiz Augusto von Dentz \u003cluiz.von.dentz@intel.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4c090d2a6eed2297f67fe8abd69d043d0ca04d21",
      "old_mode": 33188,
      "old_path": "net/bluetooth/hci_sync.c",
      "new_id": "9d71ce96bd8ec1b231ea90c777f156d8845f696d",
      "new_mode": 33188,
      "new_path": "net/bluetooth/hci_sync.c"
    }
  ]
}
