]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: restrict non-blocking connect finish
authorUrsula Braun <ubraun@linux.ibm.com>
Wed, 2 May 2018 14:53:56 +0000 (16:53 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 May 2018 17:27:19 +0000 (13:27 -0400)
commit90d24d5d551d13981a5e6eec4824cc332e42843f
treedbcd307055b4f0361d8b426306746b0aa09181ea
parent178345a4eeb4800bfdb1ff3c84103abf60e86e6a
net/smc: restrict non-blocking connect finish

The smc_poll code tries to finish connect() if the socket is in
state SMC_INIT and polling of the internal CLC-socket returns with
EPOLLOUT. This makes sense for a select/poll call following a connect
call, but not without preceding connect().
With this patch smc_poll starts connect logic only, if the CLC-socket
is no longer in its initial state TCP_CLOSE.

In addition, a poll error on the internal CLC-socket is always
propagated to the SMC socket.

With this patch the code path mentioned by syzbot
https://syzkaller.appspot.com/bug?extid=03faa2dc16b8b64be396
is no longer possible.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Reported-by: syzbot+03faa2dc16b8b64be396@syzkaller.appspotmail.com
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c