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

Alexander Mikhalitsyn alexander.mikhalitsyn at virtuozzo.com
Wed Apr 14 10:57:53 MSK 2021


From: Vladimir Davydov <vdavydov at parallels.com>

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>

=====================================================================

VZ 8 rebase part https://jira.sw.ru/browse/PSBM-127782

Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
---
 block/ioprio.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/block/ioprio.c b/block/ioprio.c
index c56ee7edbbc7..ca224f7a28be 100644
--- a/block/ioprio.c
+++ b/block/ioprio.c
@@ -153,6 +153,10 @@ SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio)
 				break;
 
 			for_each_process_thread(g, p) {
+#ifdef CONFIG_VE
+				if (p->task_ve != get_exec_env())
+					continue;
+#endif
 				if (!uid_eq(task_uid(p), uid) ||
 				    !task_pid_vnr(p))
 					continue;
@@ -243,6 +247,10 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who)
 				break;
 
 			for_each_process_thread(g, p) {
+#ifdef CONFIG_VE
+				if (p->task_ve != get_exec_env())
+					continue;
+#endif
 				if (!uid_eq(task_uid(p), user->uid) ||
 				    !task_pid_vnr(p))
 					continue;
-- 
2.28.0



More information about the Devel mailing list