AF_UNIX: Fix deadlock on connecting to shutdown socket
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / unix / af_unix.c
index 51ab497115eb7eda412870a895a8e2197adbffca..fc820cd7545309645c018da6a29d170bc67ad0f2 100644 (file)
@@ -1074,6 +1074,8 @@ restart:
        err = -ECONNREFUSED;
        if (other->sk_state != TCP_LISTEN)
                goto out_unlock;
+       if (other->sk_shutdown & RCV_SHUTDOWN)
+               goto out_unlock;
 
        if (unix_recvq_full(other)) {
                err = -EAGAIN;