From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>,
Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v2 0/4] mempolicy: prohibit mbind and set_mempolicy_home_node in VE
Date: Fri, 06 Nov 2026 15:01:31 +0100 [thread overview]
Message-ID: <20261106-b4-prep-khorenko-vstor-153679-mbind-ve-v2-0-6327b23a2d93@virtuozzo.com> (raw)
A CT is meant to see a kernel without NUMA, so the NUMA API syscalls
return -ENOSYS in a non-super VE.
mbind(2) was blocked in vz7, but the vz8 port put its check into the
compat entry point only, and the compat entry points were dropped on
the rebase to RHEL9. Since then a CT task can bind its pages to nodes
and migrate them with mbind(2), while get_mempolicy(2) tells it there
is no NUMA.
set_mempolicy_home_node(2) appeared after vz7 and was never blocked. It
only sets the home node of a policy installed by mbind(2), so it goes
with it.
The tmpfs mpol= mount option sets such a policy for all files of a
mount, and a kernel without CONFIG_NUMA rejects it. It was never
blocked in a VE either.
- Patch 1 returns -ENOSYS from both in a non-super VE.
- Patch 2 adds a ve selftest: all six NUMA API syscalls, with arguments
that succeed on the host, must return -ENOSYS in a VE.
- Patch 3 rejects mpol= in a non-super VE the way a kernel without
CONFIG_NUMA does.
- Patch 4 adds a ve selftest: a tmpfs with mpol= is created on the
host and fails with -EINVAL in a VE.
The unmerged selftests series for VSTOR-137234 carries an older
ve_numa_syscalls_prohibited_test that covers four of the syscalls with
arguments that fail on the host anyway; this version replaces it.
Tested on a 4-node host, ve_numa_syscalls_prohibited_test:
+----------------------------+--------------+--------------------------+
| kernel | host calls | calls in a VE |
+----------------------------+--------------+--------------------------+
| vz10 without patch 1 | PASS | FAIL: mbind and |
| | | set_mempolicy_home_node |
| | | return 0 |
+----------------------------+--------------+--------------------------+
| vz10 with the series | PASS | PASS |
+----------------------------+--------------+--------------------------+
ve_numa_migrate_test still passes with the series.
Tested on a 1-node VM, ve_tmpfs_mpol_test:
+----------------------------+--------------+--------------------------+
| kernel | host mpol= | mpol= in a VE |
+----------------------------+--------------+--------------------------+
| vz10 without the series | PASS | FAIL: mpol= accepted |
+----------------------------+--------------+--------------------------+
| vz10 with the series | PASS | PASS |
+----------------------------+--------------+--------------------------+
Assisted-by: LLM
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
Changes in v2:
- Patch 2: skip instead of failing when the host has no NUMA API
(Sashiko).
- New patches 3-4: reject the tmpfs mpol= mount option in a VE.
- Link to v1: http://lore.virtuozzo.com/20261105-b4-prep-khorenko-vstor-153679-mbind-ve-v1-0-b4fcd27c8001@virtuozzo.com
---
Konstantin Khorenko (4):
mempolicy: prohibit mbind and set_mempolicy_home_node in VE
selftests/ve: check that the NUMA API syscalls return ENOSYS in a VE
shmem: reject the mpol= mount option in VE
selftests/ve: check that tmpfs rejects mpol= in a VE
mm/mempolicy.c | 6 +
mm/shmem.c | 2 +-
tools/testing/selftests/ve/.gitignore | 2 +
tools/testing/selftests/ve/Makefile | 2 +
.../ve/ve_numa_syscalls_prohibited_test.c | 196 +++++++++++++++++++++
tools/testing/selftests/ve/ve_tmpfs_mpol_test.c | 123 +++++++++++++
6 files changed, 330 insertions(+), 1 deletion(-)
---
base-commit: 1f21db982845109040d1feb279e9ee34f8e6f065
change-id: 20261105-b4-prep-khorenko-vstor-153679-mbind-ve-bd811ea9be42
Best regards,
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next reply other threads:[~2026-11-06 14:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 14:01 Konstantin Khorenko [this message]
2026-11-06 14:01 ` [Devel] [PATCH hci-8.1 v2 1/4] " Konstantin Khorenko
2026-11-06 14:05 ` no-reply
2026-11-06 14:01 ` [Devel] [PATCH hci-8.1 v2 2/4] selftests/ve: check that the NUMA API syscalls return ENOSYS in a VE Konstantin Khorenko
2026-11-06 14:06 ` no-reply
2026-11-06 14:01 ` [Devel] [PATCH hci-8.1 v2 3/4] shmem: reject the mpol= mount option in VE Konstantin Khorenko
2026-11-06 14:05 ` no-reply
2026-11-06 14:01 ` [Devel] [PATCH hci-8.1 v2 4/4] selftests/ve: check that tmpfs rejects mpol= in a VE Konstantin Khorenko
2026-11-06 14:07 ` no-reply
2026-11-06 14:19 ` [Devel] [PATCH hci-8.1 v2 0/4] mempolicy: prohibit mbind and set_mempolicy_home_node in VE Vasileios Almpanis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261106-b4-prep-khorenko-vstor-153679-mbind-ve-v2-0-6327b23a2d93@virtuozzo.com \
--to=khorenko@virtuozzo.com \
--cc=devel@openvz.org \
--cc=ptikhomirov@virtuozzo.com \
--cc=vasileios.almpanis@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox