summaryrefslogtreecommitdiffstats
path: root/net/unix/garbage.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-03-13 17:08:22 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-15 02:21:45 -0400
commit326be7b484843988afe57566b627fb7a70beac56 (patch)
tree04a15bfdb681ad09444cf2f3d72ae0d38fb0432b /net/unix/garbage.c
parent65cfc6722361570bfe255698d9cd4dccaf47570d (diff)
downloadblackbird-op-linux-326be7b484843988afe57566b627fb7a70beac56.tar.gz
blackbird-op-linux-326be7b484843988afe57566b627fb7a70beac56.zip
Allow passing O_PATH descriptors via SCM_RIGHTS datagrams
Just need to make sure that AF_UNIX garbage collector won't confuse O_PATHed socket on filesystem for real AF_UNIX opened socket. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/unix/garbage.c')
-rw-r--r--net/unix/garbage.c2
1 files changed, 1 insertions, 1 deletions
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)
/*
* Socket ?
*/
- if (S_ISSOCK(inode->i_mode)) {
+ if (S_ISSOCK(inode->i_mode) && !(filp->f_mode & FMODE_PATH)) {
struct socket *sock = SOCKET_I(inode);
struct sock *s = sock->sk;
OpenPOWER on IntegriCloud