[Devel] [PATCH RHEL7 COMMIT] ve/ioprio: confine ioprio_{set, get}(IOPRIO_WHO_USER) to current ve

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jun 22 03:48:52 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.15
------>
commit 78391c5965f18186620650ed59e228ce14e947ff
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Mon Jun 22 14:48:52 2015 +0400

    ve/ioprio: confine ioprio_{set, get}(IOPRIO_WHO_USER) to current ve
    
    As long as we don't use user namespaces, we have to force
    iorpio_{set,get}(IOPRIO_WHO_USER) to iterate over processes of the
    current ve only.
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 fs/ioprio.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/ioprio.c b/fs/ioprio.c
index b54e34e..c876fad 100644
--- a/fs/ioprio.c
+++ b/fs/ioprio.c
@@ -149,6 +149,10 @@ SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio)
 				break;
 
 			do_each_thread(g, p) {
+#ifdef CONFIG_VE
+				if (p->task_ve != get_exec_env())
+					continue;
+#endif
 				if (!uid_eq(task_uid(p), uid))
 					continue;
 				ret = set_task_ioprio(p, ioprio);
@@ -244,6 +248,10 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who)
 				break;
 
 			do_each_thread(g, p) {
+#ifdef CONFIG_VE
+				if (p->task_ve != get_exec_env())
+					continue;
+#endif
 				if (!uid_eq(task_uid(p), user->uid))
 					continue;
 				tmpio = get_task_ioprio(p);



More information about the Devel mailing list