acrn-kernel/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
Kconfig
Makefile
af_can.c
af_can.h
bcm.c can: bcm: Fix UAF in bcm_proc_show() 2023-07-27 08:50:27 +02:00
gw.c
isotp.c can: isotp: fix support for transmission of SF without flow control 2023-08-30 16:11:03 +02:00
proc.c
raw.c can: raw: add missing refcount for memory leak fix 2023-08-30 16:11:11 +02:00