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
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) &&