linux-stable/net/can
Ignat Korchagin 8df832e6b9 net: af_can: do not leave a dangling sk pointer in can_create()
[ Upstream commit 811a7ca732 ]

On error can_create() frees the allocated sk object, but sock_init_data()
has already attached it to the provided sock object. This will leave a
dangling sk pointer in the sock object and may cause use-after-free later.

Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://patch.msgid.link/20241014153808.51894-5-ignat@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-14 20:03:47 +01:00
..
j1939 can: j1939: j1939_session_new(): fix skb reference counting 2024-12-14 20:03:04 +01:00
af_can.c net: af_can: do not leave a dangling sk pointer in can_create() 2024-12-14 20:03:47 +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: Clear bo->bcm_proc_read after remove_proc_entry(). 2024-09-12 09:40:08 +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: remove ISO 15675-2 specification version where possible 2024-06-20 11:52:56 +02:00
Kconfig can: isotp: remove ISO 15675-2 specification version where possible 2024-06-20 11:52:56 +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: raw_getsockopt(): reduce scope of err 2024-02-20 09:40:46 +01:00