[Devel] [PATCH RHEL7 COMMIT] vecalls: kill VZCTL_SETDEVPERMS ioctl

Konstantin Khorenko khorenko at virtuozzo.com
Thu Aug 11 02:44:51 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.22.2.vz7.16.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.22.2.vz7.16.5
------>
commit cb4a987d99e81477cbacc4a49bda0b5f501cc53c
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Thu Aug 11 13:44:51 2016 +0400

    vecalls: kill VZCTL_SETDEVPERMS ioctl
    
    All device permissions are controlled via device cgroup now.
    We don't need this ioctl() anymore.
    
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 include/uapi/linux/vzcalluser.h |  2 +-
 kernel/ve/vecalls.c             | 37 -------------------------------------
 2 files changed, 1 insertion(+), 38 deletions(-)

diff --git a/include/uapi/linux/vzcalluser.h b/include/uapi/linux/vzcalluser.h
index bc55bb3..aa4a2eb 100644
--- a/include/uapi/linux/vzcalluser.h
+++ b/include/uapi/linux/vzcalluser.h
@@ -161,7 +161,7 @@ struct vzctl_cpustatctl {
 #define VZCTLTYPE			'.'
 #define VZCTL_OLD_ENV_CREATE		_IOW(VZCTLTYPE,  0, struct vzctl_old_env_create)
 #define VZCTL_MARK_ENV_TO_DOWN		_IOW(VZCTLTYPE,  1, struct vzctl_mark_env_to_down)
-#define VZCTL_SETDEVPERMS		_IOW(VZCTLTYPE,  2, struct vzctl_setdevperms)
+#define VZCTL_SETDEVPERMS		_IOW(VZCTLTYPE,  2, struct vzctl_setdevperms) /* DEPRECATED */
 #define VZCTL_ENV_CREATE_CID		_IOW(VZCTLTYPE,  4, struct vzctl_env_create_cid)
 #define VZCTL_ENV_CREATE		_IOW(VZCTLTYPE,  5, struct vzctl_env_create)
 #define VZCTL_GET_CPU_STAT		_IOW(VZCTLTYPE,  6, struct vzctl_cpustatctl)
diff --git a/kernel/ve/vecalls.c b/kernel/ve/vecalls.c
index 4742576..5ce3e29 100644
--- a/kernel/ve/vecalls.c
+++ b/kernel/ve/vecalls.c
@@ -97,29 +97,6 @@ out_put_ve:
 	return retval;
 }
 
-static int real_setdevperms(envid_t veid, unsigned type,
-		dev_t dev, unsigned mask)
-{
-	struct ve_struct *ve;
-	int err;
-
-	if (!capable_setveid() || veid == 0)
-		return -EPERM;
-
-	if ((ve = get_ve_by_id(veid)) == NULL)
-		return -ESRCH;
-
-	down_read(&ve->op_sem);
-
-	err = -EAGAIN;
-	if (ve->is_running)
-		err = devcgroup_set_perms_ve(ve, type, dev, mask);
-
-	up_read(&ve->op_sem);
-	put_ve(ve);
-	return err;
-}
-
 /**********************************************************************
  **********************************************************************
  *
@@ -604,20 +581,6 @@ int vzcalls_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		        err = 0;
 		}
 		break;
-	    case VZCTL_SETDEVPERMS: {
-			/* Device type was mistakenly declared as dev_t
-			 * in the old user-kernel interface.
-			 * That's wrong, dev_t is a kernel internal type.
-			 * I use `unsigned' not having anything better in mind.
-			 * 2001/08/11  SAW  */
-			struct vzctl_setdevperms s;
-			err = -EFAULT;
-			if (copy_from_user(&s, (void __user *)arg, sizeof(s)))
-				break;
-			err = real_setdevperms(s.veid, s.type,
-					new_decode_dev(s.dev), s.mask);
-		}
-		break;
 #ifdef CONFIG_INET
 	    case VZCTL_VE_NETDEV: {
 			struct vzctl_ve_netdev d;


More information about the Devel mailing list