)]}'
{
  "commit": "19bb609b45fbbab4cfd9a8765dc8cb9c90cfda34",
  "tree": "283715198fa1cb23ba2761be622a92d01a1265d5",
  "parents": [
    "999976097d70e80452dee159710847f007e147f2"
  ],
  "author": {
    "name": "Carlos Llamas",
    "email": "cmllamas@google.com",
    "time": "Mon Aug 01 18:25:11 2022 +0000"
  },
  "committer": {
    "name": "Carlos Llamas",
    "email": "cmllamas@google.com",
    "time": "Tue Aug 02 20:15:27 2022 +0000"
  },
  "message": "FROMLIST: binder: fix UAF of ref-\u003eproc caused by race condition\n\nA transaction of type BINDER_TYPE_WEAK_HANDLE can fail to increment the\nreference for a node. In this case, the target proc normally releases\nthe failed reference upon close as expected. However, if the target is\ndying in parallel the call will race with binder_deferred_release(), so\nthe target could have released all of its references by now leaving the\ncleanup of the new failed reference unhandled.\n\nThe transaction then ends and the target proc gets released making the\nref-\u003eproc now a dangling pointer. Later on, ref-\u003enode is closed and we\nattempt to take spin_lock(\u0026ref-\u003eproc-\u003einner_lock), which leads to the\nuse-after-free bug reported below. Let\u0027s fix this by cleaning up the\nfailed reference on the spot instead of relying on the target to do so.\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: use-after-free in _raw_spin_lock+0xa8/0x150\n  Write of size 4 at addr ffff5ca207094238 by task kworker/1:0/590\n\n  CPU: 1 PID: 590 Comm: kworker/1:0 Not tainted 5.19.0-rc8 #10\n  Hardware name: linux,dummy-virt (DT)\n  Workqueue: events binder_deferred_func\n  Call trace:\n   dump_backtrace.part.0+0x1d0/0x1e0\n   show_stack+0x18/0x70\n   dump_stack_lvl+0x68/0x84\n   print_report+0x2e4/0x61c\n   kasan_report+0xa4/0x110\n   kasan_check_range+0xfc/0x1a4\n   __kasan_check_write+0x3c/0x50\n   _raw_spin_lock+0xa8/0x150\n   binder_deferred_func+0x5e0/0x9b0\n   process_one_work+0x38c/0x5f0\n   worker_thread+0x9c/0x694\n   kthread+0x188/0x190\n   ret_from_fork+0x10/0x20\n\nSigned-off-by: Carlos Llamas \u003ccmllamas@google.com\u003e\nAcked-by: Christian Brauner (Microsoft) \u003cbrauner@kernel.org\u003e\n\nBug: 239630375\nLink: https://lore.kernel.org/all/20220801182511.3371447-1-cmllamas@google.com/\nSigned-off-by: Carlos Llamas \u003ccmllamas@google.com\u003e\nChange-Id: I5085dd0dc805a780a64c057e5819f82dd8f02868\n(cherry picked from commit ae3fa5d16a02ba7c7b170e0e1ab56d6f0ba33964)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6fee6d574986f5a32950fe75be46f5d886ba967d",
      "old_mode": 33188,
      "old_path": "drivers/android/binder.c",
      "new_id": "0a4f0e77689a21c5dab6ccb51ce0a2ab022fc6f3",
      "new_mode": 33188,
      "new_path": "drivers/android/binder.c"
    }
  ]
}
