From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 4DF4080031 for ; Thu, 19 Nov 2026 21:50:31 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AJLnFTV012809; Fri, 20 Nov 2026 00:49:18 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AJLnFTV012809 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="xADXUuee" Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AJLnAFj012784 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Fri, 20 Nov 2026 00:49:10 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AJLnAFj012784 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-c49df8fe86eso23148866b.2 for ; Thu, 19 Nov 2026 13:49:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErENNxFp1pFJBM4SIRzDhLhtAuGH0i2Ts1wSfVHil0Xt35RklfC/u9pB7NGkoExUP4fSIkBJLg==@openvz.org X-Gm-Message-State: APuU4Z+JKSNznJYe6uXwRViY1lViJtThi0Vi71YS44ybjndy3+AJDaYy g+VCc5XLkdpSoc1cqUV9D4nqOT0qKU0k+7iIaZH7tn0hF0RpsDTgtGR4SMp3WlVZ4TBPrCG2vzW FIFay+C8DkdWtEhvjAcmp0baoaguzd3e9iTziUgkECia7ZHts85xWQA== X-Gm-Gg: AYBFou2pZ9MiNJ7Fr+bLtlbumL7fTbsj+oaNIOGBNlWwojY9kqkDhATktXnJXYHMxw6 9+/PRag7YTx7wr0EoLeb6dgRgt3UyYfq63KurRxIS9tyBJtJ/qkDbgyB62NobQkbfbc2fi1++Gh L7Bw7Z1SW2KRTC1ZdI/7QRVdtfXzFNnKO+67Z4jfFH54fFUqSmE0KL2GI6Qk1GD4qCIsYQDLouy a8Yc+vYU8QNrzoO/sk8XmUNVvdXkjh1UeI6NTu8Hi1ghABY4/vCs5BuffQbiyLNMZm3DmgMvnYL FYqgLSM0F5VF0ZNEw6COx+OdViELorQ75CwCgbdNNNMPD32ICCTd/j7Spn8Su72uZg8fhqrTGDF UJzont4lcmn9lv3HUdQ== X-Received: by 2002:a17:907:ea8e:b0:c49:a235:8e0c with SMTP id a640c23a62f3a-c513aadb22dmr119347066b.22.1795124950255; Thu, 19 Nov 2026 13:49:10 -0800 (PST) X-Received: by 2002:a17:907:ea8e:b0:c49:a235:8e0c with SMTP id a640c23a62f3a-c513aadb22dmr119345366b.22.1795124949629; Thu, 19 Nov 2026 13:49:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795124949; cv=none; d=google.com; s=arc-20260327; b=Dhh9leAzZ/6ks/HSMnA7VAgaKmXm2gsPYmG2U1UiEzoG7a51/TqtbUqc0t95Rr/k/S 8uOAfml2oYtpUhiDl8smjvuRriKpAQBfWtfZopvjUdxhIglfttBpYcftlnrfBTWUinw/ YqdWyJda8AZtkZSj9Jsa8U+t9sik7LQ2afqSbHYT2o0rzVRTr2j9LkOpA1KTrmnrNhHt 8HMakqDAJDc+p/FOfKEExk4Os2iGk4Sycq/VI/G9VwU7GkZuq18NKNGERgXdfbi3FBaa 0PxS5lls1u9T8yrUZCzEwcmVMV2THeYB27HONPz6sHYPzWBPRzmiU0FMzM7dokgiKd7O hZ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=OWT8Tj7ShemxYsJOHvf+yy0b7N3x7VxlRdgwg9L/uL8=; fh=xqcbrIOv/j1NC9DwWL7cs9wu5dYsNcrfZRJG6Y55lVA=; b=fsjvw+NBfEeRpm1lr9v7H6+SxE2W32X/ByfHK549v0a09iX64Bho3nv8HHPQ+uaa73 WUmsYIMhjNhClNxc0iNxfgPfaakc8cXyxt9cD2OZaw4iNXrzS4gGk2SzxKjqFj6oEI9A IDSw8XsW33Eqep0HZkGem5fzs1w/Ub1WWBdMklyFPPrj9ENuJnDHx5W8gMT3LnInJKkr maeBW2x+ePZvNoXKsvz8DbhnktSc5NOO7d+B41IfjY2GOJEdWahtAAhklRP1oqiyacRf XhkNmGvfP4o0e6q8Lcwh5wxu81pQ4Z6oVhD5M9IKZiZqpiJ49xrz51M/Ns+JjPdW3UMd F9mQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=xADXUuee; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id a640c23a62f3a-c513b0dae79si66295566b.385.2026.11.19.13.49.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2026 13:49:09 -0800 (PST) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=xADXUuee; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Content-Type:MIME-Version:Subject:Date :From; bh=OWT8Tj7ShemxYsJOHvf+yy0b7N3x7VxlRdgwg9L/uL8=; b=xADXUueeiBes7gEdvjp 5qklfjVl5cGShNr/qoL8B4lrns5RHpNLQE1BbE2ajQ3lQk9F4Lh71ZZ/aoyNmGvyQ4hP9Tmtu7ZJZ 7diTg5QzK94DyaNZFd7+HjT7nazccpGERhVn4mXl/38lm1tNwLFdM3Cq3FkA3RF2FazYvgxapvNad gXX5dr04OEO6eP3xON9JTLZ0PzFq3mk+MbTXQC3YHAPNXK17Ke4oLwnFUkWl0ryFFJGbDs1nFRgDo 1D7qH4qA5PlZ54M05h2O196f+gmJ5okwAj3B4Agylhx//afJiFfhLskCWn3izxYjBsz+nx7IhEISn OdB0cV6389eKu7A==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xUA0A-006nPs-1W; Thu, 19 Nov 2026 22:49:06 +0100 From: Konstantin Khorenko Date: Thu, 19 Nov 2026 22:49:02 +0100 MIME-Version: 1.0 Message-Id: <20261119-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v1-1-06fa0b8994a8@virtuozzo.com> References: <20261119-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v1-0-06fa0b8994a8@virtuozzo.com> In-Reply-To: <20261119-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v1-0-06fa0b8994a8@virtuozzo.com> To: Mirian Shilakadze , Pavel Tikhomirov X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3080; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=qqLF5/L5PaApbcSWPYYqEaCyX5pAZtV4+BTU0cLg1j0=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBq/27TkbJ9dVK9BwcrhcovItYcuoyfKqoeDJV/N +xc+7fH87qJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCav9u0wAKCRBRlgpH+WFc Kgb7D/9Z+ZoXf/+abdQBBe2dckDU8q7xT0EE/a5IldPcDcpvIUINabrU1GYxpMTBN+DxT0elFjN hpxGB5POItGd3CybW4h0XzD9CPtGbuI7uEodKWk7dOeZGMnX0xKqChhto4OnoFwGd0lY4LWAece Jc6+3pk/l1OYkakPDdg73x8VwcspxxAofxixjfD0Z8wuvf/Gt1HVUlYM7JeVi3LAitVnNGSdVOY 9M13AH/nkyHLKbXbyfEBBcB+KKymdEyqaXpbminhGC5BCI2fel1QOLMTMu2HH+uZu0Gyvc5axCz ecpM5aboNwvfAavmehOYNTaBBKpNvR9uxnVVmBKmHIa/PWXgSEyZu0214e+olJjDfRIcbPEWLK3 rOKVKGhxjV2xDz1YjDYE185NGnh1OJRmBxfYVgi/VUh9ocCUYYpW1PmpMbATRqLVQJYJGZoivfo sgR/4R/YuOCYXSZN99G2BwOovuzYa2Sc1FOIp0wCD4f1Mb7eaiAVgGR8KWKp4XMlo2C0ZeaMPRH vUkWsYC/vysm0yPHkXTw5hDAiAcqbc3nAGI9H/YVMoPMQyr2YcP/XNPHL+Lkn3i+B6+d9tBNcsT Fwn5cFYxp7bTXELES6VZHYiL/PwRF6A3DSZUcbJpL/dSbNFFiBqYuQ8B/h4MX02Hwt3coipT4/h JrfoPv3nXyWWhxg== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH RFC hci-8.2 1/2] ve: mark a host task entering a pseudosuper VE as a setup task X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org ve_setup_task() marks a task the host sends into a VE as VD_VE_SETUP_TASK only while the VE is VE_STATE_STARTING, and as VD_VE_ENTER_TASK afterwards. While the VE is pseudosuper, a setup task is reachable only from another setup task. libvzctl before 10.0.144 writes START to ve.state, which ends in VE_STATE_RUNNING, before it configures the disk: a helper then enters the init task's namespaces one by one through setns(), the VE namespace among them, and opens /proc//ns/mnt. It enters a running VE, so it becomes an ENTER task, and pseudosuper is cleared only after the setup, so the init task, a setup task, is still hidden from it. Every container start with such a libvzctl fails: Failed to open /proc//ns/mnt: Permission denied Failed to configure disk Cancel init execution libvzctl 10.0.144 and newer open the namespaces before joining any and are not affected. A host task entering a VE that is still pseudosuper is part of its setup whatever ve.state says: mark it VD_VE_SETUP_TASK while is_pseudosuper is set. Container binaries such a helper execs still drop the mark on exec, so they gain nothing. Fixes: a7d797d177e7 ("ve: hide the tasks that set up a starting VE from the rest of it") https://virtuozzo.atlassian.net/browse/VSTOR-156164 Feature: trace: prohibit tracing sensitive tasks from CT Signed-off-by: Konstantin Khorenko --- kernel/ve/ve.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c index 076892a750cfc..7323ea2053ac6 100644 --- a/kernel/ve/ve.c +++ b/kernel/ve/ve.c @@ -1899,18 +1899,19 @@ void ve_setup_task(struct task_struct *task, struct ve_struct *old_ve, return; /* - * A task the host sends into a starting VE is a setup task, one it - * sends into a started VE is hidden from the tasks of the VE. A setup - * task leaving a VE that is still pseudosuper was sent by the host - * too. The mark goes to the mm, which may be shared, so a task coming - * from a container never gets either. A setup task leaving a VE that - * is not pseudosuper drops the mark: after pseudosuper is cleared it - * cannot be told from the restored processes. + * A task the host sends into a VE (from ve0, or a setup task of a + * VE still pseudosuper) becomes a setup task if the VE starts or + * stays pseudosuper, else one hidden from the VE's tasks. + * + * The mark lives in the mm, which may be shared, so a task from a + * container keeps its mark, except a setup mark of a VE that left + * pseudosuper: it is an ordinary task now. */ if (mm && old_ve != ve) { if (ve_is_super(old_ve) || ve_vps_dumpable(mm, old_ve) == VD_VE_SETUP_TASK) - mm->vps_dumpable = ve->state == VE_STATE_STARTING ? + mm->vps_dumpable = ve->state == VE_STATE_STARTING || + ve->is_pseudosuper ? VD_VE_SETUP_TASK : VD_VE_ENTER_TASK; else if (mm->vps_dumpable == VD_VE_SETUP_TASK) mm->vps_dumpable = VD_PTRACE_COREDUMP; -- 2.43.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel