[Devel] [PATCH rh7] devmptfs: Use current_user_ns_initial() in dev_mount()

Kirill Tkhai ktkhai at odin.com
Wed Oct 7 03:22:49 PDT 2015


Use the helper instead of hardcoded check.

Suggested-by: Vladimir Davydov <vdavydov at odin.com>
Signed-off-by: Kirill Tkhai <ktkhai at odin.com>
---
 drivers/base/devtmpfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index 9f3809c..92840a0 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -105,7 +105,7 @@ static struct dentry *ve_dev_mount(struct file_system_type *fs_type, int flags,
 static struct dentry *dev_mount(struct file_system_type *fs_type, int flags,
 		      const char *dev_name, void *data)
 {
-	if (get_exec_env()->init_cred->user_ns != current_user_ns())
+	if (!current_user_ns_initial())
 		return ERR_PTR(-EPERM);
 
 #ifdef CONFIG_VE




More information about the Devel mailing list