[Devel] [PATCH RHEL8 COMMIT] ve/fs/ioprio: Confine ioprio_{set, get}(IOPRIO_WHO_USER) to current ve
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Apr 15 20:30:47 MSK 2021
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.14
------>
commit b88376b777183394a45205b33ba7fbe2904b7660
Author: Vladimir Davydov <vdavydov.dev at gmail.com>
Date: Thu Apr 15 20:30:46 2021 +0300
ve/fs/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>
=====================================================================
VZ 8 rebase part https://jira.sw.ru/browse/PSBM-127782
vz7 commit: b74a04f ("ve/fs/ioprio: confine ioprio_{set, get}(IOPRIO_WHO_USER)
to current ve")
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;
More information about the Devel
mailing list