]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: reduce sock_put() for fallback sockets
authorUrsula Braun <ubraun@linux.ibm.com>
Thu, 5 Jul 2018 14:15:30 +0000 (16:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Jul 2018 11:25:13 +0000 (20:25 +0900)
commitf488f47850cd956d92bf9244a3186ac7f0120eb1
tree76e741e90f29cedf93a749cb68d9695704482958
parent95005267e91be0fefb8d469a6ffd287f5168f57e
net/smc: reduce sock_put() for fallback sockets

smc_release() calls a sock_put() for smc fallback sockets to cover
the passive closing sock_hold() in __smc_connect() and
smc_tcp_listen_work(). This does not make sense for sockets in state
SMC_LISTEN and SMC_INIT.
An SMC socket stays in state SMC_INIT if connect fails. The sock_put
in smc_connect_abort() does not cover all failures. Move it into
smc_connect_decline_fallback().

Fixes: 8d716f2265c89 ("net/smc: handle sockopts forcing fallback")
Reported-by: syzbot+3a0748c8f2f210c0ef9b@syzkaller.appspotmail.com
Reported-by: syzbot+9e60d2428a42049a592a@syzkaller.appspotmail.com
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c
net/smc/smc_close.c