diff options
| author | Joas Antonio dos Santos <joasantonio108@gmail.com> | 2026-11-10 03:55:41 +0000 |
|---|---|---|
| committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2026-11-10 10:40:48 -0500 |
| commit | 45a25a1bfd267d9e420119a48e5291d7882395df (patch) | |
| tree | 9eda3a8de15f940be36643945f34a56cb3e575f8 /tools/perf/scripts/python/event_analyzing_sample.py | |
| parent | 1f2ac56137c51be0601e18a163d817e02a15913f (diff) | |
Bluetooth: hci_qca: clear qca_memdump when discarding dump packets
qca_controller_memdump() frees qca_memdump when a memdump packet with a
non-zero sequence number arrives while QCA_MEMDUMP_COLLECTION is not
set, but leaves qca->qca_memdump pointing at the freed object.
The next run of the work reads the stale pointer into its local
variable, skips the allocation and uses the freed memory. Another
packet with a non-zero sequence number frees it a second time, and a
packet with sequence number 0 writes ram_dump_size, current_seq_no and
received_dump into it.
The original code cleared the pointer here; the assignment was dropped
when the condition was changed to test QCA_MEMDUMP_COLLECTION. All
other places that free the structure clear the pointer.
A controller that sends two memdump events without a leading sequence
number 0 can trigger a use-after-free or double free of a kmalloc
object.
Found by LLM-assisted source review.
Fixes: 06d3fdfcdf5c ("Bluetooth: hci_qca: Add qcom devcoredump support")
Cc: stable@vger.kernel.org
Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions
