From cc5eaf94f068674b9d6a2df14e86249352cfb0a2 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 13 Mar 2011 17:08:22 -0400 Subject: [PATCH] --- yaml --- r: 234287 b: refs/heads/master c: 326be7b484843988afe57566b627fb7a70beac56 h: refs/heads/master i: 234285: fc59d6c7bf513373003c716e970368d17e6a07ba 234283: 16cc2778126443315271e8fb75fb710fd7e16bbf 234279: 7554331b070e0dc2f5317eddfa795b913652d319 234271: 6613994bd04522ef48414189a396483c32958bfb v: v3 --- [refs] | 2 +- trunk/fs/file_table.c | 2 ++ trunk/net/core/scm.c | 2 +- trunk/net/unix/garbage.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 9c2990040366..a50c5daed411 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 65cfc6722361570bfe255698d9cd4dccaf47570d +refs/heads/master: 326be7b484843988afe57566b627fb7a70beac56 diff --git a/trunk/fs/file_table.c b/trunk/fs/file_table.c index 3c16e1ca163e..74a9544ac770 100644 --- a/trunk/fs/file_table.c +++ b/trunk/fs/file_table.c @@ -305,6 +305,8 @@ struct file *fget_raw(unsigned int fd) return file; } +EXPORT_SYMBOL(fget_raw); + /* * Lightweight file lookup - no refcnt increment if fd table isn't shared. * diff --git a/trunk/net/core/scm.c b/trunk/net/core/scm.c index bbe454450801..4c1ef026d695 100644 --- a/trunk/net/core/scm.c +++ b/trunk/net/core/scm.c @@ -95,7 +95,7 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp) int fd = fdp[i]; struct file *file; - if (fd < 0 || !(file = fget(fd))) + if (fd < 0 || !(file = fget_raw(fd))) return -EBADF; *fpp++ = file; fpl->count++; diff --git a/trunk/net/unix/garbage.c b/trunk/net/unix/garbage.c index f89f83bf828e..b6f4b994eb35 100644 --- a/trunk/net/unix/garbage.c +++ b/trunk/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;