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

Vladimir Davydov vdavydov at parallels.com
Sun Jun 21 08:38:14 PDT 2015


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 b54e34e6bd35..c876fad6b157 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);
-- 
2.1.4




More information about the Devel mailing list