[RH7,04/32] Revert "ms/tun: Add ioctl() SIOCGSKNS cmd to allow obtaining net ns of tun device"

Submitted by Pavel Tikhomirov on June 8, 2020, 5:05 p.m.

Details

Message ID 20200608170602.308872-5-ptikhomirov@virtuozzo.com
State New
Series "port nsfs from vz8"
Headers show

Commit Message

Pavel Tikhomirov June 8, 2020, 5:05 p.m.
This reverts commit 7cb9e7ae7041f348f2be384ea17352e117f3d00d.

We switch from procfs ns-files to nsfs ones, so we will apply nsfs
version of the patch instead.

https://jira.sw.ru/browse/PSBM-102357

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 drivers/net/tun.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index c2bebdeab0bc..81b305abbf05 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -71,7 +71,6 @@ 
 #include <net/sock.h>
 #include <linux/skb_array.h>
 #include <linux/seq_file.h>
-#include <linux/proc_ns.h>
 
 #include <asm/uaccess.h>
 
@@ -2339,7 +2338,7 @@  static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
 	bool do_notify = false;
 
 	if (cmd == TUNSETIFF || cmd == TUNSETQUEUE || cmd == TUNSETACCTID ||
-	    (_IOC_TYPE(cmd) == 0x89 && cmd != SIOCGSKNS)) {
+			_IOC_TYPE(cmd) == 0x89) {
 		if (copy_from_user(&ifr, argp, ifreq_len))
 			return -EFAULT;
 	} else {
@@ -2391,14 +2390,6 @@  static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
 		tfile->ifindex = ifindex;
 		goto unlock;
 	}
-	if (cmd == SIOCGSKNS) {
-		ret = -EPERM;
-		if (!ns_capable(tfile->net->user_ns, CAP_NET_ADMIN))
-			goto unlock;
-
-		ret = open_net_ns_fd(tfile->net);
-		goto unlock;
-	}
 
 	ret = -EBADFD;
 	if (!tun)