linux-stable/net/tipc
Fedor Pchelkin fcc62b0e34 tipc: stop tipc crypto on failure in tipc_node_create
[ Upstream commit de52e17326 ]

If tipc_link_bc_create() fails inside tipc_node_create() for a newly
allocated tipc node then we should stop its tipc crypto and free the
resources allocated with a call to tipc_crypto_start().

As the node ref is initialized to one to that point, just put the ref on
tipc_link_bc_create() error case that would lead to tipc_node_free() be
eventually executed and properly clean the node and its crypto resources.

Found by Linux Verification Center (linuxtesting.org).

Fixes: cb8092d70a ("tipc: move bc link creation back to tipc_node_create")
Suggested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/20230725214628.25246-1-pchelkin@ispras.ru
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-03 10:25:54 +02:00
..
Kconfig
Makefile
addr.c tipc: introduce new unified address type for internal use 2021-03-17 11:51:04 -07:00
addr.h tipc: introduce new unified address type for internal use 2021-03-17 11:51:04 -07:00
bcast.c net: tipc: fix FB_MTU eat two pages 2021-06-28 13:31:57 -07:00
bcast.h
bearer.c net: tipc: resize nlattr array to correct size 2023-06-15 14:59:17 -07:00
bearer.h tipc: add tipc_bearer_min_mtu to calculate min mtu 2023-05-15 10:21:20 +01:00
core.c tipc: fix use-after-free Read in tipc_named_reinit 2022-06-17 11:39:10 +01:00
core.h tipc: simplify the finalize work queue 2021-05-18 13:22:09 -07:00
crypto.c tipc: check return value of pskb_trim() 2023-08-03 10:25:54 +02:00
crypto.h net/tipc: fix tipc header files for kernel-doc 2020-12-01 15:37:41 -08:00
diag.c
discover.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
discover.h
eth_media.c tipc: constify dev_addr passing 2021-10-13 09:40:46 -07:00
group.c tipc: update address terminology in code 2020-11-27 17:34:01 -08:00
group.h tipc: update address terminology in code 2020-11-27 17:34:01 -08:00
ib_media.c tipc: constify dev_addr passing 2021-10-13 09:40:46 -07:00
link.c tipc: do not update mtu if msg_max is too small in mtu negotiation 2023-05-15 10:21:20 +01:00
link.h tipc: simplify the finalize work queue 2021-05-18 13:22:09 -07:00
monitor.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
monitor.h
msg.c net: tipc: replace align() with ALIGN in msg.c 2021-06-28 13:31:57 -07:00
msg.h net: tipc: remove unused static inlines 2022-01-27 13:53:27 +00:00
name_distr.c net/tipc: Remove unused struct distr_queue_item 2022-09-29 18:48:32 -07:00
name_distr.h net/tipc: fix tipc header files for kernel-doc 2020-12-01 15:37:41 -08:00
name_table.c tipc: cleanup unused function 2022-06-17 11:43:57 +01:00
name_table.h tipc: cleanup unused function 2022-06-17 11:43:57 +01:00
net.c tipc: simplify the finalize work queue 2021-05-18 13:22:09 -07:00
net.h
netlink.c genetlink: start to validate reserved header bytes 2022-08-29 12:47:15 +01:00
netlink.h
netlink_compat.c string_helpers: Move string_is_valid() to the header 2023-02-09 22:30:24 -08:00
node.c tipc: stop tipc crypto on failure in tipc_node_create 2023-08-03 10:25:54 +02:00
node.h
socket.c net: deal with most data-races in sk_wait_event() 2023-05-10 10:03:32 +01:00
socket.h tipc: add stricter control of reserved service types 2020-10-30 08:19:18 -07:00
subscr.c tipc:subscr.c: fix a spelling mistake 2021-06-10 13:48:43 -07:00
subscr.h tipc: fix htmldoc and smatch warnings 2021-03-29 16:28:50 -07:00
sysctl.c
topsrv.c net/sock: Introduce trace_sk_data_ready() 2023-01-23 11:26:50 +00:00
topsrv.h
trace.c net/tipc: fix various kernel-doc warnings 2020-12-01 15:37:46 -08:00
trace.h
udp_media.c tipc: add tipc_bearer_min_mtu to calculate min mtu 2023-05-15 10:21:20 +01:00
udp_media.h