diff options
author | Ursula Braun <ubraun@linux.ibm.com> | 2018-08-08 08:13:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-08 22:14:22 -0400 |
commit | caa21e19e08d7a1445116a93f7ab4e187ebbbadb (patch) | |
tree | 5cc5dccf2d25d7305186bbf5cf94e67563f8d9bf /net/smc | |
parent | 11ba961c916127651e12af6cad3891f8aeb25aa9 (diff) |
net/smc: no shutdown in state SMC_LISTEN
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>
Diffstat (limited to 'net/smc')
-rw-r--r-- | net/smc/af_smc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 05e4ffe5aabd..1288c7bf40d5 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c | |||
@@ -1397,8 +1397,7 @@ static int smc_shutdown(struct socket *sock, int how) | |||
1397 | lock_sock(sk); | 1397 | lock_sock(sk); |
1398 | 1398 | ||
1399 | rc = -ENOTCONN; | 1399 | rc = -ENOTCONN; |
1400 | if ((sk->sk_state != SMC_LISTEN) && | 1400 | if ((sk->sk_state != SMC_ACTIVE) && |
1401 | (sk->sk_state != SMC_ACTIVE) && | ||
1402 | (sk->sk_state != SMC_PEERCLOSEWAIT1) && | 1401 | (sk->sk_state != SMC_PEERCLOSEWAIT1) && |
1403 | (sk->sk_state != SMC_PEERCLOSEWAIT2) && | 1402 | (sk->sk_state != SMC_PEERCLOSEWAIT2) && |
1404 | (sk->sk_state != SMC_APPCLOSEWAIT1) && | 1403 | (sk->sk_state != SMC_APPCLOSEWAIT1) && |