]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: fix fastopen for non-blocking connect()
authorUrsula Braun <ubraun@linux.ibm.com>
Fri, 15 Nov 2019 11:39:30 +0000 (12:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 Nov 2019 21:03:33 +0000 (13:03 -0800)
commitb4ced38b40d98ccc1a6c17594d90219e956bf222
treed03e35ca966bb3310276b80a10caebb70d497ecc
parent9138e2c20c64bae4d16bdb2979edbe6934577818
net/smc: fix fastopen for non-blocking connect()

FASTOPEN does not work with SMC-sockets. Since SMC allows fallback to
TCP native during connection start, the FASTOPEN setsockopts trigger
this fallback, if the SMC-socket is still in state SMC_INIT.
But if a FASTOPEN setsockopt is called after a non-blocking connect(),
this is broken, and fallback does not make sense.
This change complements
commit d5b03f861241 ("net/smc: avoid fallback in case of non-blocking connect")
and fixes the syzbot reported problem "WARNING in smc_unhash_sk".

Reported-by: syzbot+8488cc4cf1c9e09b8b86@syzkaller.appspotmail.com
Fixes: f488f47850cd ("net/smc: reduce sock_put() for fallback sockets")
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c