Skip to content

can: fix same memory leaks in can drivers

Pavel Skripkin linux-can lkml netdev oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyIn review
  2. v13 patches 2 repliesSuperseded

Changes in v2 from the cover letter

Fixed compilation error in 3rd patch
Fixed cover letter

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3can: usb_8dev: fix memory leakdrivers/net/can/usb/usb_8dev.c+13 -20 replies
2/3can: ems_usb: fix memory leakdrivers/net/can/usb/ems_usb.c+13 -10 replies
3/3can: esd_usb2: fix memory leakdrivers/net/can/usb/esd_usb2.c+15 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] can: fix same memory leaks in can drivers

Hi, Marc and can drivers maintainers/reviewers!

A long time ago syzbot reported memory leak in mcba_usb can driver[1]. It was using strange pattern for allocating coherent buffers, which was leading to memory leaks. I fixed this wrong pattern in mcba_usb driver and yesterday I got a report, that mcba_usb stopped working since my commit. I came up with quick fix and all started working well.

There are at least 3 more drivers with this pattern, I decided to fix leaks in them too, since code is actually the same (I guess, driver authors just copy pasted code parts). Each of following patches is combination of 91c02557174b ("can: mcba_usb: fix memory leak in mcba_usb") and my yesterday fix [2].

Dear maintainers/reviewers, if You have one of these hardware pieces, please, test these patches and report any errors you will find.

[1] https://syzkaller.appspot.com/bug?id=c94c1c23e829d5ac97995d51219f0c5a0cd1fa54
[2] https://lore.kernel.org/netdev/[email protected]/

v1 -> v2
Fixed compilation error in 3rd patch
Fixed cover letter

With regards,
Pavel Skripkin

Pavel Skripkin (3):
can: usb_8dev: fix memory leak
can: ems_usb: fix memory leak
can: esd_usb2: fix memory leak

 drivers/net/can/usb/ems_usb.c  | 14 +++++++++++++-
 drivers/net/can/usb/esd_usb2.c | 16 +++++++++++++++-
 drivers/net/can/usb/usb_8dev.c | 15 +++++++++++++--
 3 files changed, 41 insertions(+), 4 deletions(-)
Signature · 1 line
2.32.0