]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: fix refcounting for non-blocking connect()
authorUrsula Braun <ubraun@linux.ibm.com>
Tue, 29 Oct 2019 11:41:26 +0000 (12:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Oct 2019 01:09:50 +0000 (18:09 -0700)
commitbe6a5772df3474941cad04d6e8c3071780f4bd62
treed4deee3abb8aa430a567609272aa9df7369c21d3
parentdec8a6d18aec720804d1b3ab87e8193d125c2e8e
net/smc: fix refcounting for non-blocking connect()

If a nonblocking socket is immediately closed after connect(),
the connect worker may not have started. This results in a refcount
problem, since sock_hold() is called from the connect worker.
This patch moves the sock_hold in front of the connect worker
scheduling.

Reported-by: syzbot+4c063e6dea39e4b79f29@syzkaller.appspotmail.com
Fixes: e38c366065f1 ("net/smc: nonblocking connect rework")
Reviewed-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c