]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: postpone sk_refcnt increment in connect()
authorliuyacan <liuyacan@corp.netease.com>
Mon, 23 May 2022 04:57:07 +0000 (12:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 May 2022 08:58:47 +0000 (09:58 +0100)
commit7600abf5252bd53827a765864b7b0dc0910c7934
tree7af193059b6dde734a092cd48f24ce417f4cd0fc
parentc3e944adf854047fa8d14043126956cfd7bdb6cd
net/smc: postpone sk_refcnt increment in connect()

Same trigger condition as commit c60c96f0. 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: c60c96f0f08f ("net/smc: add fallback check to connect()")
Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c