History

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.

Ursula Braun committed 8 years ago

Commit caa21e11 parent 11ba9611 file · +1 −2Browse files

Unified · Split

net/smc/af_smc.c+1−2
@@ -1397,8 +1397,7 @@ static int smc_shutdown(struct socket *sock, int how) · 1396 unmodified lines
13971397 lock_sock(sk);
13981398
13991399 rc = -ENOTCONN;
1400− if ((sk->sk_state != SMC_LISTEN) &&
1401− (sk->sk_state != SMC_ACTIVE) &&
1400+ if ((sk->sk_state != SMC_ACTIVE) &&
14021401 (sk->sk_state != SMC_PEERCLOSEWAIT1) &&
14031402 (sk->sk_state != SMC_PEERCLOSEWAIT2) &&
14041403 (sk->sk_state != SMC_APPCLOSEWAIT1) &&