]> git.proxmox.com Git - mirror_ubuntu-eoan-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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 4 Dec 2019 09:29:26 +0000 (10:29 +0100)
commitbd948038eb8dbb4e5cf7c5aec8f2d7be768ad5e9
treeea62fd245de4c93ae7e49719054d1afe1e546920
parenta0e9f4d1cb19a76536e9114912dd7d36342a19d6
net/smc: fix fastopen for non-blocking connect()

BugLink: https://bugs.launchpad.net/bugs/1853475
[ Upstream commit 8204df72bea1a7d83d0777add6da98a41dfbdc34 ]

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 cd2063604ea6 ("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: e1bbdd570474 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/smc/af_smc.c