All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v5 2/5] ve: Introduce override_ve/revert_ve helpers
Date: Thu, 12 Nov 2026 14:17:01 +0100	[thread overview]
Message-ID: <179448942112.4060562.12042466360723083159.b4-review@b4> (raw)
In-Reply-To: <20261110-ovl-use-orig-ve-v5-2-f3f2bdb29e23@virtuozzo.com>

I won't apply this version, please send v6 with the changes below.

On Tue, 10 Nov 2026 18:26:49 +0100, Vladimir Riabchun <vladimir.riabchun@virtuozzo.com> wrote:
> This field is not supposed to be inherited via fork, so report
> a check for this was added as well.

- Item 6 of the cover letter reply: rewrite this sentence, and say in
  the message that ve_capable() now uses overrided_ve and which VE
  switches are allowed, refused, or skipped.

The sentence does not parse. The message also never says that
ve_capable() and ve_capable_noaudit() change, or what override_ve()
does for a CT caller. That is the part a reader of this patch needs.

> +	/* CT tasks are not supposed to switch VE context, this is a breach */
> +	if (new_ve != get_exec_env() && !ve_is_super(get_exec_env())) {
> +		if (ve_is_super(new_ve)) {
> +			/* Don't cry about it, this event we may allow. */
> +			return ERR_PTR(-EPERM);
> +		}

- Item 1 of the cover letter reply: return the current override
  (old_ve) here, and ERR_PTR(-EPERM) for the cross-CT case below.

ERR_PTR(-EPERM) here means "go on, just do not switch the VE", so the
caller has to tell this error from a real one, and patch 5 does that
twice with PTR_ERR() != -EPERM. Returning old_ve gives the same
ve_capable() result: overrided_ve stays as it was, and revert_ve()
writes back the same value. Then any error pointer is a real refusal,
and the "this is a breach" comment no longer covers an allowed case.

> +		pr_err_ratelimited("Invalid VE override: %s -> %s\n",
> +					ve_name(get_exec_env()),
> +					ve_name(new_ve));

- Item 2 of the cover letter reply: do not print ve_name(new_ve).

new_ve is the creator VE of the overlay. It is pinned only by
get_ve(), and the CT may already be stopped and its cgroup removed.
ve_offline() frees ve->ve_name with plain kfree() and no RCU, so this
can read freed memory, or print "(null)".

> +	WARN_ON(orig->overrided_ve);

- Item 3 of the cover letter reply: WARN_ON_ONCE.

If this ever fires, it fires on every fork in the window. One trace
is enough.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

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

  parent reply	other threads:[~2026-11-12 13:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 17:26 [Devel] [PATCH hci-8.1 v5 0/5] Fix kernel crash in overlayfs Vladimir Riabchun
2026-11-10 17:26 ` [Devel] [PATCH hci-8.1 v5 1/5] ve: Remove STOPPED state Vladimir Riabchun
2026-11-10 17:32   ` no-reply
2026-11-12 13:17   ` Konstantin Khorenko
2026-11-10 17:26 ` [Devel] [PATCH hci-8.1 v5 2/5] ve: Introduce override_ve/revert_ve helpers Vladimir Riabchun
2026-11-10 17:35   ` no-reply
2026-11-12 13:17   ` Konstantin Khorenko [this message]
2026-11-12 20:41     ` Vladimir Riabchun
2026-11-13 20:21       ` Konstantin Khorenko
2026-11-10 17:26 ` [Devel] [PATCH hci-8.1 v5 3/5] ve: Defer ve creds drop until ve is completely destroyed Vladimir Riabchun
2026-11-10 17:32   ` no-reply
2026-11-12 13:17   ` Konstantin Khorenko
2026-11-16 11:43     ` Vladimir Riabchun
2026-11-10 17:26 ` [Devel] [PATCH hci-8.1 v5 4/5] ovl: Keep creator VE in overlayfs superblock Vladimir Riabchun
2026-11-10 17:32   ` no-reply
2026-11-12 13:17   ` Konstantin Khorenko
2026-11-10 17:26 ` [Devel] [PATCH hci-8.1 v5 5/5] ve/overlayfs: Override VE together with creds Vladimir Riabchun
2026-11-10 17:37   ` no-reply
2026-11-10 17:54     ` Vladimir Riabchun
2026-11-12 13:17   ` Konstantin Khorenko
2026-11-16 11:48     ` Vladimir Riabchun
2026-11-11 12:51 ` [Devel] [PATCH hci-8.1 v5 0/5] Fix kernel crash in overlayfs Vasileios Almpanis
2026-11-12 13:17 ` Konstantin Khorenko

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=179448942112.4060562.12042466360723083159.b4-review@b4 \
    --to=khorenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --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.