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 3/6] ve: Defer ve creds drop until ve is completely destroyed
Date: Mon, 16 Nov 2026 17:26:22 +0000 [thread overview]
Message-ID: <010701a1e5654773-01417b02-9d42-4a4d-80bf-4ef9e94fa6e2-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261116-ovl-use-orig-ve-v7-3-37daa56081ed@virtuozzo.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ve: init_cred now outlives VE stop, changing
NULL-means-not-running checks undocumented
--
commit fb3c64a0ae176947a1145ebda4ba570e97c3e935
Author: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>
ve: Defer ve creds drop until ve is completely destroyed
This moves the put of ve->init_cred out of ve_drop_context() into a new
ve_drop_cred(), which ve_destroy() calls. That way the creds stay valid
while users of a dead VE, such as an overlayfs superblock, still need them.
> diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
> --- a/kernel/ve/ve.c
> +++ b/kernel/ve/ve.c
> @@ -378,7 +378,10 @@ static void ve_drop_context(struct ve_struct *ve)
> rcu_assign_pointer(ve->ve_nsproxy, NULL);
> synchronize_rcu();
> put_nsproxy(ve_nsproxy);
> +}
>
> +static void ve_drop_cred(struct ve_struct *ve)
> +{
> put_cred(ve->init_cred);
> ve->init_cred = NULL;
> }
[Severity: Low]
As reported by Konstantin Khorenko on v5 [1], init_cred now stays non-NULL
after a VE stops or fails to start. Is this behavioral change intended to be
left undocumented?
Several users treat init_cred == NULL as "VE not running". These are
ve_capable(), ve_capable_noaudit(), netlink_ve_capable(), ve_init_user_ns()
and sget_fc(). For a dead VE they now take the container branch. For
example, ve_init_user_ns() returns the container user_ns instead of
init_user_ns, which changes the early return in mount_too_revealing(). The
ve0 fallback in ve_capable() is likewise no longer taken.
The patch only renames the comments from "ve isn't running" to "ve isn't
started". The commit message does not say that these checks change for a
dead VE, and it is unclear whether these users were audited. Could the
message describe the new semantics, with NULL meaning only "never
started"?
[1] https://lore.kernel.org/r/179448942112.4060562.14182200426614413151.b4-review@b4
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261116-ovl-use-orig-ve-v7-0-37daa56081ed@virtuozzo.com?part=3
_______________________________________________
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
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 [this message]
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=010701a1e5654773-01417b02-9d42-4a4d-80bf-4ef9e94fa6e2-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 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.