linux-stable/net/smc
liuyacan 8eb0e5a265 net/smc: postpone sk_refcnt increment in connect()
[ Upstream commit 75c1edf23b ]

Same trigger condition as commit 86434744. When setsockopt runs
in parallel to a connect(), and switch the socket into fallback
mode. Then the sk_refcnt is incremented in smc_connect(), but
its state stay in SMC_INIT (NOT SMC_ACTIVE). This cause the
corresponding sk_refcnt decrement in __smc_release() will not be
performed.

Fixes: 86434744fe ("net/smc: add fallback check to connect()")
Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:23:03 +02:00
..
af_smc.c net/smc: postpone sk_refcnt increment in connect() 2022-06-09 10:23:03 +02:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile net/smc: Add SMC statistics support 2021-06-16 12:54:02 -07:00
smc.h net/smc: Forward wakeup to smc socket waitqueue after fallback 2022-02-08 18:34:09 +01:00
smc_cdc.c net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:42:36 +01:00
smc_cdc.h net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:42:36 +01:00
smc_clc.c net/smc: add missing error check in smc_clc_prfx_set() 2021-09-21 10:54:16 +01:00
smc_clc.h net/smc: Add support for obtaining system information 2020-12-01 17:56:13 -08:00
smc_close.c net/smc: Keep smc_close_final rc during active close 2021-12-08 09:04:50 +01:00
smc_close.h net/smc: remove close abort worker 2019-10-22 11:23:44 -07:00
smc_core.c net/smc: correct settings of RMB window update limit 2022-04-13 20:59:07 +02:00
smc_core.h net/smc: Reset conn->lgr when link group registration fails 2022-01-27 11:03:53 +01:00
smc_diag.c net/smc: Introduce SMCR get link command 2020-12-01 17:56:13 -08:00
smc_ib.c net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:42:36 +01:00
smc_ib.h net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:42:36 +01:00
smc_ism.c net/smc: no need to flush smcd_dev's event_wq before destroying it 2021-06-03 13:54:49 -07:00
smc_ism.h net/smc: Add support for obtaining SMCD device list 2020-12-01 17:56:13 -08:00
smc_llc.c net/smc: don't send CDC/LLC message if link not ready 2022-01-05 12:42:36 +01:00
smc_llc.h net/smc: move add link processing for new device into llc layer 2020-07-19 15:30:22 -07:00
smc_netlink.c net/smc: Add netlink support for SMC fallback statistics 2021-06-16 12:54:02 -07:00
smc_netlink.h net/smc: Add netlink support for SMC fallback statistics 2021-06-16 12:54:02 -07:00
smc_netns.h net/smc: introduce list of pnetids for Ethernet devices 2020-09-28 15:19:03 -07:00
smc_pnet.c net/smc: Fix NULL pointer dereference in smc_pnet_find_ib() 2022-04-20 09:34:11 +02:00
smc_pnet.h net/smc: Use a mutex for locking "struct smc_pnettable" 2022-03-02 11:47:59 +01:00
smc_rx.c net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending 2022-05-18 10:26:51 +02:00
smc_rx.h
smc_stats.c net/smc: Fix ENODATA tests in smc_nl_get_fback_stats() 2021-06-21 12:16:58 -07:00
smc_stats.h net/smc: Make SMC statistics network namespace aware 2021-06-16 12:54:02 -07:00
smc_tx.c net/smc: Send directly when TCP_CORK is cleared 2022-04-13 20:59:02 +02:00
smc_tx.h net/smc: Send directly when TCP_CORK is cleared 2022-04-13 20:59:02 +02:00
smc_wr.c net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:42:36 +01:00
smc_wr.h net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:42:36 +01:00