linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH can 0/3] can: gs_usb: fix USB bulk in and out callbacks
@ 2025-11-08  9:01 Marc Kleine-Budde
  2025-11-08  9:01 ` [PATCH can 1/3] can: gs_usb: gs_usb_xmit_callback(): fix handling of failed transmitted URBs Marc Kleine-Budde
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Marc Kleine-Budde @ 2025-11-08  9:01 UTC (permalink / raw)
  To: Vincent Mailhol, Maximilian Schneider, Wolfgang Grandegger
  Cc: kernel, linux-can, linux-kernel, Marc Kleine-Budde

The bulk-out callback gs_usb_xmit_callback() does not take care of the
cleanup of failed transfers of URBs. The 1st patch adds the missing
cleanup.

The bulk-in callback gs_usb_receive_bulk_callback() accesses the buffer of
the URB without checking how much data has actually been received. The last
2 patches fix this problem.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Marc Kleine-Budde (3):
      can: gs_usb: gs_usb_xmit_callback(): fix handling of failed transmitted URBs
      can: gs_usb: gs_usb_receive_bulk_callback(): check actual_length before accessing header
      can: gs_usb: gs_usb_receive_bulk_callback(): check actual_length before accessing data

 drivers/net/can/usb/gs_usb.c | 108 +++++++++++++++++++++++++++++++++++++------
 1 file changed, 94 insertions(+), 14 deletions(-)
---
base-commit: 74d4432421a3e2669fbccc08c0f4fc2980bf0e39
change-id: 20251107-gs_usb-fix-usb-callbacks-5fa2955299c3

Best regards,
--  
Marc Kleine-Budde <mkl@pengutronix.de>


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH can 0/3] can: gs_usb: fix USB bulk in and out callbacks
@ 2025-11-14  8:36 Marc Kleine-Budde
  2025-11-16 16:06 ` Marc Kleine-Budde
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Kleine-Budde @ 2025-11-14  8:36 UTC (permalink / raw)
  To: Vincent Mailhol, Wolfgang Grandegger, Maximilian Schneider
  Cc: Henrik Brix Andersen, kernel, linux-can, linux-kernel,
	Marc Kleine-Budde

The bulk-out callback gs_usb_xmit_callback() does not take care of the
cleanup of failed transfers of URBs. The 1st patch adds the missing
cleanup.

The bulk-in callback gs_usb_receive_bulk_callback() accesses the buffer of
the URB without checking how much data has actually been received. The last
2 patches fix this problem.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes in v2:
- patch 3: TX-echo length: take timestamps into account (thanks: Henrik)
- Link to v1: https://patch.msgid.link/20251108-gs_usb-fix-usb-callbacks-v1-0-8a2534a7ea05@pengutronix.de

---
Marc Kleine-Budde (3):
      can: gs_usb: gs_usb_xmit_callback(): fix handling of failed transmitted URBs
      can: gs_usb: gs_usb_receive_bulk_callback(): check actual_length before accessing header
      can: gs_usb: gs_usb_receive_bulk_callback(): check actual_length before accessing data

 drivers/net/can/usb/gs_usb.c | 102 +++++++++++++++++++++++++++++++++++++------
 1 file changed, 88 insertions(+), 14 deletions(-)
---
base-commit: 407a06507c2358554958e8164dc97176feddcafc
change-id: 20251107-gs_usb-fix-usb-callbacks-5fa2955299c3

Best regards,
--  
Marc Kleine-Budde <mkl@pengutronix.de>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-16 16:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-08  9:01 [PATCH can 0/3] can: gs_usb: fix USB bulk in and out callbacks Marc Kleine-Budde
2025-11-08  9:01 ` [PATCH can 1/3] can: gs_usb: gs_usb_xmit_callback(): fix handling of failed transmitted URBs Marc Kleine-Budde
2025-11-08  9:01 ` [PATCH can 2/3] can: gs_usb: gs_usb_receive_bulk_callback(): check actual_length before accessing header Marc Kleine-Budde
2025-11-08  9:01 ` [PATCH can 3/3] can: gs_usb: gs_usb_receive_bulk_callback(): check actual_length before accessing data Marc Kleine-Budde
2025-11-11 12:31   ` Henrik Brix Andersen
2025-11-11 13:55     ` Marc Kleine-Budde
  -- strict thread matches above, loose matches on Subject: below --
2025-11-14  8:36 [PATCH can 0/3] can: gs_usb: fix USB bulk in and out callbacks Marc Kleine-Budde
2025-11-16 16:06 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).