summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorAldo Ariel Panzardo <qwe.aldo@gmail.com>2026-09-15 13:03:07 -0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2026-09-16 13:51:34 -0400
commitb0a6cf99afd57a39598b1beca0e86ef5004980de (patch)
treedc4596b01af6da94ff4814c1979ba6dc6afbeb52 /tools/perf/scripts/python/stackcollapse.py
parente93fad891c72deb84cae49430163b384ebcc92b1 (diff)
downloadlinux-b0a6cf99afd57a39598b1beca0e86ef5004980de.tar.gz
linux-b0a6cf99afd57a39598b1beca0e86ef5004980de.zip
Bluetooth: hci_sock: validate event length before filtering
is_filtered_packet() reads the event code from skb->data[0] without first checking that the skb is nonempty. When an opcode filter is configured, it also reads the command opcode at offsets 3 or 4 without checking that a Command Complete or Command Status event is long enough. hci_send_to_sock() invokes the filter before hci_event_packet() validates the event header. A malformed event supplied by a controller or a vhci device can therefore cause an out-of-bounds read. Keep the unmasked event code for the opcode checks. The masked value is needed for the 64-bit event bitmap, but using it to identify command events aliases event codes above 0x3f. In particular, Synchronous Train Complete (0x4f) was treated as Command Status (0x0f) even though its payload has no opcode. Reject actual command events that are too short for the field being inspected. A truncated command event cannot match a configured opcode. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions