All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
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 3/4] shmem: reject the mpol= mount option in VE
Date: Fri, 06 Nov 2026 15:01:34 +0100	[thread overview]
Message-ID: <20261106-b4-prep-khorenko-vstor-153679-mbind-ve-v2-3-6327b23a2d93@virtuozzo.com> (raw)
In-Reply-To: <20261106-b4-prep-khorenko-vstor-153679-mbind-ve-v2-0-6327b23a2d93@virtuozzo.com>

A CT is meant to see a kernel without NUMA support, so the NUMA API
syscalls return -ENOSYS in a non-super VE. The tmpfs mpol= mount option
still lets a CT set a NUMA memory policy for all files of a tmpfs
mount.

Reject mpol= in a non-super VE the way a kernel built without
CONFIG_NUMA does: the mount fails with -EINVAL and "Unsupported
parameter 'mpol'".

https://virtuozzo.atlassian.net/browse/VSTOR-153679

Feature: mm: prohibit NUMA API inside CT
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 mm/shmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index f8cea7e5de88d..8862723003fb0 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4378,7 +4378,7 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
 		ctx->seen |= SHMEM_SEEN_HUGE;
 		break;
 	case Opt_mpol:
-		if (IS_ENABLED(CONFIG_NUMA)) {
+		if (IS_ENABLED(CONFIG_NUMA) && ve_is_super(get_exec_env())) {
 			mpol_put(ctx->mpol);
 			ctx->mpol = NULL;
 			if (mpol_parse_str(param->string, &ctx->mpol))

-- 
2.43.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent 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 [Devel] [PATCH hci-8.1 v2 0/4] mempolicy: prohibit mbind and set_mempolicy_home_node " Konstantin Khorenko
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 ` Konstantin Khorenko [this message]
2026-11-06 14:05   ` [Devel] [PATCH hci-8.1 v2 3/4] shmem: reject the mpol= mount option in VE 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-3-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.