kdbus: allow unix domain socket fd passing 67/91667/4
authorKonrad Lipinski <konrad.l@samsung.com>
Fri, 15 Jul 2016 11:15:05 +0000 (13:15 +0200)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 14 Oct 2016 12:51:09 +0000 (14:51 +0200)
[ This commit re-applies change Ifafec44da924ec8ed677629606c92a45e7171636 to new kdbus upstream version. ]
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Change-Id: Ib293d0d864a3a91cf8422bcccc1f7593285868a1

ipc/kdbus/message.c

index ae565cd343f80640dc765b27a3a4cb6f2a1ccb4d..66b9325f03d0703bcf501ce98cc42e9685ebec2b 100644 (file)
@@ -229,8 +229,6 @@ exit:
 static struct file *kdbus_get_fd(int fd)
 {
        struct file *f, *ret;
-       struct inode *inode;
-       struct socket *sock;
 
        if (fd < 0)
                return ERR_PTR(-EBADF);
@@ -239,15 +237,10 @@ static struct file *kdbus_get_fd(int fd)
        if (!f)
                return ERR_PTR(-EBADF);
 
-       inode = file_inode(f);
-       sock = S_ISSOCK(inode->i_mode) ? SOCKET_I(inode) : NULL;
-
        if (f->f_mode & FMODE_PATH)
                ret = f; /* O_PATH is always allowed */
        else if (f->f_op == &kdbus_handle_ops)
                ret = ERR_PTR(-EOPNOTSUPP); /* disallow kdbus-fd over kdbus */
-       else if (sock && sock->sk && sock->ops && sock->ops->family == PF_UNIX)
-               ret = ERR_PTR(-EOPNOTSUPP); /* disallow UDS over kdbus */
        else
                ret = f; /* all other are allowed */