Commit 8204df72 authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller
Browse files

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 cd206360

 ("net/smc: avoid fallback in case of non-blocking connect")
and fixes the syzbot reported problem "WARNING in smc_unhash_sk".

Reported-by: default avatar <>
Fixes: e1bbdd57

 ("net/smc: reduce sock_put() for fallback sockets")
Signed-off-by: default avatarUrsula Braun <>
Signed-off-by: default avatarKarsten Graul <>
Signed-off-by: default avatarDavid S. Miller <>
parent a36e629e
......@@ -1732,7 +1732,7 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,
/* option not supported by SMC */
if (sk->sk_state == SMC_INIT) {
if (sk->sk_state == SMC_INIT && !smc->connect_nonblock) {
smc->fallback_rsn = SMC_CLC_DECL_OPTUNSUPP;
} else {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment