)]}'
{
  "commit": "04898b6d69ac1f02089115baa9ce5f45643d39a2",
  "tree": "8f1659df0917576572a099a181f9cb19760e4b5f",
  "parents": [
    "72d37a2601cb705ec452206df5d940023fd8a83b"
  ],
  "author": {
    "name": "Duy Truong",
    "email": "duytruong@google.com",
    "time": "Thu Jun 18 05:45:27 2026 +0000"
  },
  "committer": {
    "name": "Android Build Coastguard Worker",
    "email": "android-build-coastguard-worker@google.com",
    "time": "Fri Sep 04 11:03:44 2026 -0700"
  },
  "message": "Fix OOB read and UAF in InputDispatcher::flushSensor\n\nIn `InputDispatcher::flushSensor()`, erasing an element from\n`mInboundQueue` returns an iterator that was unconditionally\nincremented by the loop. If the erased element was the last one,\nthe increment advanced the iterator past `end()`, resulting in an\nout-of-bounds read and use-after-free when the next iteration\ndereferenced the invalid iterator.\n\nThis patch fixes the issue by updating the loop to only increment\nthe iterator when an element is not erased. Additionally, the\nfunction now properly inspects the `SensorEntry` fields to ensure\nonly inbound sensor events matching the specified `deviceId` and\n`sensorType` parameters are erased, whereas previously it was\nunconditionally erasing all sensor events.\n\nThis change also includes additional fix in tests to make them\ndeterministic by freeze dispatching before the events are enqueued,\nthen add the events, and then call flush.\n\nTest: atest inputflinger_tests --host\nBug: 514737201\nFlag: EXEMPT BUGFIX\nLow-Coverage-Reason: coverage infra is broken\n\nCherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:321a057cca83b8a7843b394b644ed7ab9a24cefd\n\nCherrypicked by Aesir (go/aesir-backport-automation)\nCherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:806489cfc8926abfd25e56d09cbb780e08a0f662\nMerged-In: I2b5e1ffd224864e20b0f86dce0aea9bf87a7dd8a\nChange-Id: I2b5e1ffd224864e20b0f86dce0aea9bf87a7dd8a\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "836147d939bc3d8ede8da7ed3948a4183d758e8d",
      "old_mode": 33188,
      "old_path": "services/inputflinger/dispatcher/InputDispatcher.cpp",
      "new_id": "bc717bd8317a374c9f592c71836f2d68fd2ba33b",
      "new_mode": 33188,
      "new_path": "services/inputflinger/dispatcher/InputDispatcher.cpp"
    },
    {
      "type": "modify",
      "old_id": "3df05f4bae4efdf7c6d582dbff109b7a0de68e0c",
      "old_mode": 33188,
      "old_path": "services/inputflinger/tests/FakeInputDispatcherPolicy.cpp",
      "new_id": "4a65b8dacb8683285ac4c4539fc82fa4e7bf7d17",
      "new_mode": 33188,
      "new_path": "services/inputflinger/tests/FakeInputDispatcherPolicy.cpp"
    },
    {
      "type": "modify",
      "old_id": "a0f3ea900807cdd827e08220e64d6a641fe56398",
      "old_mode": 33188,
      "old_path": "services/inputflinger/tests/FakeInputDispatcherPolicy.h",
      "new_id": "4f20a85efa54df043b97b38ee75efb68f5249e83",
      "new_mode": 33188,
      "new_path": "services/inputflinger/tests/FakeInputDispatcherPolicy.h"
    },
    {
      "type": "modify",
      "old_id": "5eab6be07429735c545b03aa940356b16498c939",
      "old_mode": 33188,
      "old_path": "services/inputflinger/tests/InputDispatcher_test.cpp",
      "new_id": "e777699b9a74b065d5a3152daa3d5109f204b207",
      "new_mode": 33188,
      "new_path": "services/inputflinger/tests/InputDispatcher_test.cpp"
    },
    {
      "type": "modify",
      "old_id": "65fb9c6659dc7dc1ce5af183794ab818aa3e6745",
      "old_mode": 33188,
      "old_path": "services/inputflinger/tests/TestEventMatchers.h",
      "new_id": "184e108fdc25206bcbbcfb8b0cc81e6265d916aa",
      "new_mode": 33188,
      "new_path": "services/inputflinger/tests/TestEventMatchers.h"
    }
  ]
}
