From 5321a72869f91cb9d9a912beacf7a16e97c80ad5 Mon Sep 17 00:00:00 2001 From: Konrad Lipinski Date: Fri, 15 Jul 2016 13:15:05 +0200 Subject: [PATCH] kdbus: allow unix domain socket fd passing [ This commit re-applies change Ifafec44da924ec8ed677629606c92a45e7171636 to new kdbus upstream version. ] Signed-off-by: Karol Lewandowski Change-Id: Ib293d0d864a3a91cf8422bcccc1f7593285868a1 --- ipc/kdbus/message.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c index ae565cd343f8..66b9325f03d0 100644 --- a/ipc/kdbus/message.c +++ b/ipc/kdbus/message.c @@ -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 */ -- 2.34.1