linux-stable/net/can
Oliver Hartkopp f67e3a725b can: raw: add missing refcount for memory leak fix
commit c275a176e4 upstream.

Commit ee8b94c851 ("can: raw: fix receiver memory leak") introduced
a new reference to the CAN netdevice that has assigned CAN filters.
But this new ro->dev reference did not maintain its own refcount which
lead to another KASAN use-after-free splat found by Eric Dumazet.

This patch ensures a proper refcount for the CAN nedevice.

Fixes: ee8b94c851 ("can: raw: fix receiver memory leak")
Reported-by: Eric Dumazet <edumazet@google.com>
Cc: Ziyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/r/20230821144547.6658-3-socketcan@hartkopp.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-30 16:11:11 +02:00
..
j1939 can: j1939: avoid possible use-after-free when j1939_can_rx_register fails 2023-06-14 11:15:26 +02:00
af_can.c can: af_can: fix NULL pointer dereference in can_rcv_filter 2022-12-07 10:30:47 +01:00
af_can.h
bcm.c can: bcm: Fix UAF in bcm_proc_show() 2023-07-27 08:50:27 +02:00
gw.c can: skb: unify skb CAN frame identification helpers 2022-09-15 09:08:08 +02:00
isotp.c can: isotp: fix support for transmission of SF without flow control 2023-08-30 16:11:03 +02:00
Kconfig net: Kconfig: move the CAN device menu to the "Device Drivers" section 2022-06-11 17:11:02 +02:00
Makefile
proc.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
raw.c can: raw: add missing refcount for memory leak fix 2023-08-30 16:11:11 +02:00