• Ursula Braun's avatar
    net/smc: fix fastopen for non-blocking connect() · 8204df72
    Ursula Braun authored
    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: syzbot+8488cc4cf1c9e09b8b86@syzkaller.appspotmail.com
    Fixes: e1bbdd57 ("net/smc: reduce sock_put() for fallback sockets")
    Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
    Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8204df72
af_smc.c 52.4 KB