[Devel] [PATCH 1/3] proc-net: revert e5990221bde54d757a5b5d85e81b2535064570ad

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu Jul 20 19:47:48 MSK 2017


Revert "proc-net: mark all files in proc-net directories as virtualized".

This tirck doesn't allow to define any non-visible per-net dentry, while we
will need it it to support container migration with disabled netfilter.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 fs/proc/generic.c       |    3 ---
 fs/proc/proc_net.c      |    1 -
 include/linux/proc_fs.h |    2 +-
 3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 0e7f570..b45d765 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -433,9 +433,6 @@ static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp
 		return -EINVAL;
 	}
 
-	if (dir->mode & S_ISGID)
-		dp->mode |= S_ISVTX;
-
 	spin_lock(&proc_subdir_lock);
 
 	dp->parent = dir;
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
index 886ca0e..7dc6a31 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -207,7 +207,6 @@ static __net_init int proc_net_ns_init(struct net *net)
 	netd->nlink = 2;
 	netd->namelen = 3;
 	netd->parent = &proc_root;
-	netd->mode = S_ISGID;
 	memcpy(netd->name, "net", 4);
 
 	err = -EEXIST;
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 2e34adc..4660327 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -110,7 +110,7 @@ struct net;
 static inline struct proc_dir_entry *proc_net_mkdir(
 	struct net *net, const char *name, struct proc_dir_entry *parent)
 {
-	return proc_mkdir_data(name, S_ISGID|S_IRUGO|S_IXUGO, parent, net);
+	return proc_mkdir_data(name, S_ISVTX|S_IRUGO|S_IXUGO, parent, net);
 }
 
 #endif /* _LINUX_PROC_FS_H */



More information about the Devel mailing list