lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260116-can_usb-fix-memory-leak-v2-0-4b8cb2915571@pengutronix.de>
Date: Fri, 16 Jan 2026 20:35:13 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Vincent Mailhol <mailhol@...nel.org>, 
 Wolfgang Grandegger <wg@...ndegger.com>, 
 Sebastian Haas <haas@...-wuensche.com>, 
 "David S. Miller" <davem@...emloft.net>, 
 Frank Jungclaus <frank.jungclaus@....eu>, socketcan@....eu, 
 Yasushi SHOJI <yashi@...cecubics.com>, Daniel Berglund <db@...ser.com>, 
 Olivier Sobrie <olivier@...rie.be>, 
 Remigiusz Kołłątaj <remigiusz.kollataj@...ica.com>, 
 Bernd Krumboeck <b.krumboeck@...il.com>
Cc: kernel@...gutronix.de, linux-can@...r.kernel.org, 
 linux-kernel@...r.kernel.org, Marc Kleine-Budde <mkl@...gutronix.de>, 
 stable@...r.kernel.org
Subject: [PATCH can v2 0/5] can: usb: fix URB memory leaks

An URB memory leak [1][2] was recently fixed in the gs_usb driver. The
driver did not take into account that completed URBs are no longer
anchored, causing them to be lost during ifdown. The memory leak was fixed
by re-anchoring the URBs in the URB completion callback.

Several USB CAN drivers are affected by the same error. Fix them
accordingly.

[1] https://lore.kernel.org/all/20260109135311.576033-3-mkl@pengutronix.de/
[2] https://lore.kernel.org/all/20260116-can_usb-fix-reanchor-v1-1-9d74e7289225@pengutronix.de/

Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
---
Changes in v2:
- removed Remigiusz Kołłątaj from list of recipients
  (their email address is no longer valid)
- rebased to latest net/main
- all: add review feedback, unanchor in case of error
  https://lore.kernel.org/all/20260110223836.3890248-1-kuba@kernel.org/
- Link to v1: https://patch.msgid.link/20260110-can_usb-fix-memory-leak-v1-0-4a7c082a7081@pengutronix.de

---
Marc Kleine-Budde (5):
      can: ems_usb: ems_usb_read_bulk_callback(): fix URB memory leak
      can: esd_usb: esd_usb_read_bulk_callback(): fix URB memory leak
      can: kvaser_usb: kvaser_usb_read_bulk_callback(): fix URB memory leak
      can: mcba_usb: mcba_usb_read_bulk_callback(): fix URB memory leak
      can: usb_8dev: usb_8dev_read_bulk_callback(): fix URB memory leak

 drivers/net/can/usb/ems_usb.c                    | 8 +++++++-
 drivers/net/can/usb/esd_usb.c                    | 9 ++++++++-
 drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 9 ++++++++-
 drivers/net/can/usb/mcba_usb.c                   | 8 +++++++-
 drivers/net/can/usb/usb_8dev.c                   | 8 +++++++-
 5 files changed, 37 insertions(+), 5 deletions(-)
---
base-commit: a74c7a58ca2ca1cbb93f4c01421cf24b8642b962
change-id: 20260109-can_usb-fix-memory-leak-0d769e002393

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ