linux-stable/net/can
Oliver Hartkopp 0a47ffcac3 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 14:52:42 +02:00
..
j1939 can: j1939: avoid possible use-after-free when j1939_can_rx_register fails 2023-06-05 08:26:40 +02:00
Kconfig
Makefile
af_can.c
af_can.h
bcm.c can: bcm: Fix UAF in bcm_proc_show() 2023-07-27 08:56:36 +02:00
gw.c
isotp.c can: isotp: fix support for transmission of SF without flow control 2023-08-30 14:52:32 +02:00
proc.c
raw.c can: raw: add missing refcount for memory leak fix 2023-08-30 14:52:42 +02:00