diff options
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 19 | ||||
-rw-r--r-- | net/unix/garbage.c | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index dd419d286204..ba5b8c208498 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -850,7 +850,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
850 | * Get the parent directory, calculate the hash for last | 850 | * Get the parent directory, calculate the hash for last |
851 | * component. | 851 | * component. |
852 | */ | 852 | */ |
853 | err = path_lookup(sunaddr->sun_path, LOOKUP_PARENT, &nd); | 853 | err = kern_path_parent(sunaddr->sun_path, &nd); |
854 | if (err) | 854 | if (err) |
855 | goto out_mknod_parent; | 855 | goto out_mknod_parent; |
856 | 856 | ||
@@ -1724,7 +1724,11 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1724 | 1724 | ||
1725 | msg->msg_namelen = 0; | 1725 | msg->msg_namelen = 0; |
1726 | 1726 | ||
1727 | mutex_lock(&u->readlock); | 1727 | err = mutex_lock_interruptible(&u->readlock); |
1728 | if (err) { | ||
1729 | err = sock_intr_errno(sock_rcvtimeo(sk, noblock)); | ||
1730 | goto out; | ||
1731 | } | ||
1728 | 1732 | ||
1729 | skb = skb_recv_datagram(sk, flags, noblock, &err); | 1733 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
1730 | if (!skb) { | 1734 | if (!skb) { |
@@ -1864,7 +1868,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1864 | memset(&tmp_scm, 0, sizeof(tmp_scm)); | 1868 | memset(&tmp_scm, 0, sizeof(tmp_scm)); |
1865 | } | 1869 | } |
1866 | 1870 | ||
1867 | mutex_lock(&u->readlock); | 1871 | err = mutex_lock_interruptible(&u->readlock); |
1872 | if (err) { | ||
1873 | err = sock_intr_errno(timeo); | ||
1874 | goto out; | ||
1875 | } | ||
1868 | 1876 | ||
1869 | do { | 1877 | do { |
1870 | int chunk; | 1878 | int chunk; |
@@ -1895,11 +1903,12 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1895 | 1903 | ||
1896 | timeo = unix_stream_data_wait(sk, timeo); | 1904 | timeo = unix_stream_data_wait(sk, timeo); |
1897 | 1905 | ||
1898 | if (signal_pending(current)) { | 1906 | if (signal_pending(current) |
1907 | || mutex_lock_interruptible(&u->readlock)) { | ||
1899 | err = sock_intr_errno(timeo); | 1908 | err = sock_intr_errno(timeo); |
1900 | goto out; | 1909 | goto out; |
1901 | } | 1910 | } |
1902 | mutex_lock(&u->readlock); | 1911 | |
1903 | continue; | 1912 | continue; |
1904 | unlock: | 1913 | unlock: |
1905 | unix_state_unlock(sk); | 1914 | unix_state_unlock(sk); |
diff --git a/net/unix/garbage.c b/net/unix/garbage.c index f89f83bf828e..b6f4b994eb35 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c | |||
@@ -104,7 +104,7 @@ struct sock *unix_get_socket(struct file *filp) | |||
104 | /* | 104 | /* |
105 | * Socket ? | 105 | * Socket ? |
106 | */ | 106 | */ |
107 | if (S_ISSOCK(inode->i_mode)) { | 107 | if (S_ISSOCK(inode->i_mode) && !(filp->f_mode & FMODE_PATH)) { |
108 | struct socket *sock = SOCKET_I(inode); | 108 | struct socket *sock = SOCKET_I(inode); |
109 | struct sock *s = sock->sk; | 109 | struct sock *s = sock->sk; |
110 | 110 | ||