summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-sqlite.py
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@bitwise.fi>2022-10-10 18:08:26 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2022-10-11 09:50:44 +0300
commit1499ecaea9d2ba68d5e18d80573b4561a8dc4ee7 (patch)
treee8258af872ede1bc05ee93e0b8f6230a75165ffe /tools/perf/scripts/python/export-to-sqlite.py
parentb15e2e49bfc4965d86b9bc4a8426d53ec90a7192 (diff)
downloadlinux-1499ecaea9d2ba68d5e18d80573b4561a8dc4ee7.tar.xz
can: kvaser_usb_leaf: Fix overread with an invalid command
For command events read from the device, kvaser_usb_leaf_read_bulk_callback() verifies that cmd->len does not exceed the size of the received data, but the actual kvaser_cmd handlers will happily read any kvaser_cmd fields without checking for cmd->len. This can cause an overread if the last cmd in the buffer is shorter than expected for the command type (with cmd->len showing the actual short size). Maximum overread seems to be 22 bytes (CMD_LEAF_LOG_MESSAGE), some of which are delivered to userspace as-is. Fix that by verifying the length of command before handling it. This issue can only occur after RX URBs have been set up, i.e. the interface has been opened at least once. Cc: stable@vger.kernel.org Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices") Tested-by: Jimmy Assarsson <extja@kvaser.com> Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi> Signed-off-by: Jimmy Assarsson <extja@kvaser.com> Link: https://lore.kernel.org/all/20221010150829.199676-2-extja@kvaser.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions