linux-stable/net/can
Ignat Korchagin 1fe625f12d 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 19:51:37 +01:00
..
j1939 can: j1939: j1939_session_new(): fix skb reference counting 2024-12-14 19:51:27 +01:00
af_can.c net: af_can: do not leave a dangling sk pointer in can_create() 2024-12-14 19:51:37 +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-10-17 15:10:46 +02:00
gw.c can: gw: synchronize rcu operations before removing gw job entry 2021-06-19 23:53:43 +02:00
isotp.c can: isotp: isotp_sendmsg(): fix TX state detection and wait behavior 2023-11-08 17:26:49 +01:00
Kconfig net: remove redundant 'depends on NET' 2021-01-27 17:04:12 -08:00
Makefile can: add ISO 15765-2:2016 transport protocol 2020-10-07 23:18:33 +02:00
proc.c can: proc: remove unnecessary variables 2021-05-27 09:42:21 +02:00
raw.c can: raw: add support for SO_MARK 2024-01-15 18:51:14 +01:00