linux/net/can
Oliver Hartkopp c275a176e4 can: raw: add missing refcount for memory leak fix
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>
2023-08-22 17:18:50 -07:00
..
j1939 sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES) 2023-06-24 15:50:13 -07:00
af_can.c net: af_can: remove useless parameter 'err' in 'can_rx_register()' 2022-12-12 11:41:24 +01:00
af_can.h can: introduce CAN midlayer private and allocate it automatically 2019-09-04 13:29:14 +02:00
bcm.c can: bcm: Fix UAF in bcm_proc_show() 2023-07-17 09:46:26 +02:00
gw.c can: gw: give feedback on missing CGW_FLAGS_CAN_IIF_TX_OK flag 2023-02-02 15:42:10 +01:00
isotp.c can: isotp: fix support for transmission of SF without flow control 2023-08-22 17:18:50 -07:00
Kconfig net: Kconfig: move the CAN device menu to the "Device Drivers" section 2022-06-11 17:11:02 +02:00
Makefile can: add ISO 15765-2:2016 transport protocol 2020-10-07 23:18:33 +02:00
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-22 17:18:50 -07:00