net/smc: no shutdown in state SMC_LISTEN
authorUrsula Braun <ubraun@linux.ibm.com>
Wed, 8 Aug 2018 12:13:19 +0000 (14:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:09:22 +0000 (13:09 +0200)
commit3f59cf41fbfb622878c53815b9f464fe5aeaf7d9
tree7f791e03da12f589509b1415f728cc3c33500803
parent9e9f27e0d7ac938a78e603ba1a2a2bdab034394b
net/smc: no shutdown in state SMC_LISTEN

commit caa21e19e08d7a1445116a93f7ab4e187ebbbadb upstream.

Invoking shutdown for a socket in state SMC_LISTEN does not make
sense. Nevertheless programs like syzbot fuzzing the kernel may
try to do this. For SMC this means a socket refcounting problem.
This patch makes sure a shutdown call for an SMC socket in state
SMC_LISTEN simply returns with -ENOTCONN.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/smc/af_smc.c