From: no-reply@sashiko.virtuozzo.com
To: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>,
vasileios.almpanis@virtuozzo.com, ptikhomirov@virtuozzo.com,
Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v7 2/6] ve: Introduce override_ve/revert_ve helpers
Date: Mon, 16 Nov 2026 17:25:51 +0000 [thread overview]
Message-ID: <010701a1e564cf2a-d6ec1bc0-01f7-4f31-9a2e-03962f66dea4-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261116-ovl-use-orig-ve-v7-2-37daa56081ed@virtuozzo.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] ve: commit message omits override_ve() VE-switching refusal
rules
- [Low] ve: feature_capable() ignores overrided_ve while ve_capable()
honours it
--
commit 5277cbabde9ed3d2f2cb580c3e77aa427fe5adf8
Author: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>
ve: Introduce override_ve/revert_ve helpers
This adds override_ve() and revert_ve(), which mirror override_creds() and revert_creds(). It also adds a task->overrided_ve field that ve_capable() and ve_capable_noaudit() now consult.
> ve: Introduce override_ve/revert_ve helpers
>
> These helpers mirror override_creds/revert_creds and are supposed to
> be used together in cases when VE creds may be stored and later used
> by the different VE task.
>
> To keep task_ve consistent for other users, introduce a separate
> task->overrided_ve field. Nobody should race on it since its
> updates are supposed to go with override_creds, and non-current
> processes shouldn't do this.
>
> ve_capable and friends now use overrided_ve field if it
> is non-NULL.
>
> This field is not supposed to be inherited via fork, so a check
> for non-NULL overrided_ve was added in fork path.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-142405
> Signed-off-by: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>
[Severity: Low]
As reported by Konstantin Khorenko on v5 [1], the message doesn't describe
what override_ve() allows and refuses. A task inside a container that
asks for any VE other than its own gets ERR_PTR(-EPERM) and a ratelimited
pr_err. Only a host (super-VE) task may switch to an arbitrary VE. The
message also doesn't say that dup_task_struct() now warns if a task forks
while an override is active. Could the message spell out these rules?
> diff --git a/kernel/capability.c b/kernel/capability.c
> --- a/kernel/capability.c
> +++ b/kernel/capability.c
> @@ -406,10 +407,11 @@ bool ve_capable(int cap)
> bool ve_capable_noaudit(int cap)
> {
> struct cred *cred;
> + struct ve_struct *ve = current->overrided_ve ?: get_exec_env();
> bool ret;
>
> rcu_read_lock();
> - cred = get_exec_env()->init_cred;
> + cred = ve->init_cred;
[Severity: Low]
Should feature_capable() be updated as well? It still tests
get_exec_env()->features and then calls ve_capable(). Inside an
override_ve() section the feature bit is then read from the task's real VE,
while the capability check uses overrided_ve->init_cred. If the real VE
lacks the feature bit, the fallback capable(cap) runs and the override is
ignored. No in-tree caller was found that reaches this from an override
section, so this is an inconsistency in semantics rather than a demonstrated
failure.
[1] https://lore.kernel.org/r/179448942112.4060562.12799497421042932533.b4-review@b4
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261116-ovl-use-orig-ve-v7-0-37daa56081ed@virtuozzo.com?part=2
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-16 17:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 17:18 [Devel] [PATCH hci-8.1 v7 0/6] Fix kernel crash in overlayfs Vladimir Riabchun
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 1/6] ve: Remove STOPPED state Vladimir Riabchun
2026-11-16 17:23 ` no-reply
2026-11-16 17:35 ` Vladimir Riabchun
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 2/6] ve: Introduce override_ve/revert_ve helpers Vladimir Riabchun
2026-11-16 17:25 ` no-reply [this message]
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 3/6] ve: Defer ve creds drop until ve is completely destroyed Vladimir Riabchun
2026-11-16 17:26 ` no-reply
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 4/6] ovl: Keep creator VE in overlayfs superblock Vladimir Riabchun
2026-11-16 17:27 ` no-reply
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 5/6] ovl: Fix leaking fd references in ovl_copyfile Vladimir Riabchun
2026-11-16 17:27 ` no-reply
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 6/6] ve/overlayfs: Override VE together with creds Vladimir Riabchun
2026-11-16 17:32 ` no-reply
2026-11-16 17:45 ` Vladimir Riabchun
2026-11-16 17:43 ` [Devel] [PATCH hci-8.1 v7 0/6] Fix kernel crash in overlayfs Konstantin Khorenko
2026-11-16 20:22 ` Vladimir Riabchun
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=010701a1e564cf2a-d6ec1bc0-01f7-4f31-9a2e-03962f66dea4-000000@eu-central-1.amazonses.com \
--to=no-reply@sashiko.virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
--cc=ptikhomirov@virtuozzo.com \
--cc=vasileios.almpanis@virtuozzo.com \
--cc=vladimir.riabchun@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