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 4A4D980032 for ; Fri, 20 Nov 2026 13:16:33 +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 6AKDFG1n019564; Fri, 20 Nov 2026 16:15:17 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AKDFG1n019564 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="oEZTeYpi" 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 6AKDF91S019527 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Fri, 20 Nov 2026 16:15:09 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AKDF91S019527 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-c4d34d6082fso78602866b.0 for ; Fri, 20 Nov 2026 05:15:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErF5fVqmhvsOZ62gmP7BtG7RzgztGJJyYM1+v7zYT+hPxnLI0Ma5+w8kXFJNffAvyVg37g3CdQ==@openvz.org X-Gm-Message-State: APuU4Z8Ptm2AANktwotqV2EGtBbDHg6mY1Rvcw1Gcj3vJWW95iLYoejA wyKlLMc1Ko5RiIXaR5DwZ5iTLW2nulfv1teO6DiB7pLN0f3dQsUxV9FvUU8vpgNBZNyLWvQxUX4 9vg42KHhRV9M9kwxorohtz7XFg3GPgziwlnWfX7fKXNPTsmwlAZqSfA== X-Gm-Gg: AZFdTZdKyW8F8hGBmzMOZql3UqdyIRkQ60NoBKFuri0VsU5mIO18OmUzDgW63GuXuGs VmiXjCpDmjlG/Ac/TDYqJcF/trLpjn2i8JiRp9NnTPstOJm5VWvHD06sDB7/xZ1SurPA1jQKxvu a75e8GoDus/2rxFcbSAeqMy87sBxx3wshwdU5mGMqm9hNirUYOJCKKf+L1ZTwV0kOWCv9ZI/yKu lK6Ke01Cax4rxAe0dZLcb8TfCBvg41VT7BOV7erHbMl7JhLBPP3DuS7VLoFQ5/8bKy/HDX7YiAD xbDaEye39iD2kR+RPpX972497S2TDE5+9EiaVUtWcwCEHauyWF++ZCBjQmVL9Cj1tGfA2Wrytgj 8TeyGLkRuM6/GIDFd X-Received: by 2002:a05:6402:13cb:b0:6b5:709e:2196 with SMTP id 4fb4d7f45d1cf-6ba37ec43e9mr2122540a12.40.1795180508958; Fri, 20 Nov 2026 05:15:08 -0800 (PST) X-Received: by 2002:a05:6402:13cb:b0:6b5:709e:2196 with SMTP id 4fb4d7f45d1cf-6ba37ec43e9mr2122521a12.40.1795180508533; Fri, 20 Nov 2026 05:15:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795180508; cv=none; d=google.com; s=arc-20260327; b=l15EGtjlhFncAjbHzVkTds+3Ly8QlfP5SRUCaNuWVM3SHA4qscpXBsqvvbhscAixhq B1UltekTH+vFNdqn2TAQYw+1rebvL7E7qCN4GmyL0IuhukNJJmd8Eiul8k7G87N/g+iW 2qRLSe5hJGE1kta+eWL8O0sOSaoc5QyMm3lyXfo83UXKPT1ppU5lyhzLkVy1FejuoBGY ndNqYabhs4Yb0eTKFrLURC8MA/wlSIxoiiYyJ4lf3dfmp8ZATDvka32lAU5d02FHT1KB szvQRprM/h/c8bHiGRCxcIoK8amHu06oLUZWrJhAuMsDXYog+B88jCIWEtxFUT25ZdrG wrVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:dkim-signature; bh=/3vSbCXGoJZr/Kufc15gYvps4NLHIIMZEIGioT/9gCY=; fh=xqcbrIOv/j1NC9DwWL7cs9wu5dYsNcrfZRJG6Y55lVA=; b=HK87e8QXO/IzM6qKKETlJIaOFYcrxk+7tIC9/p6TUdx6oEewaWUw7JX9UL3yG/5I20 S08E3K6DGbVn1J0yq2fZMAe75j+GQBQ8J6Fb2hDThgcjmN1WC0IMkFNyAzNeTjoZJYNG CsOwyu63bd4eaBffvC8WDWczMxpcVz+/Zmb7Vtr13LkpHUPK5dZDAqVD0zak6m0+J+09 D46/I9/2q99XSkfAAVHsXE8kgu6VTQf4ca0ijJ0ooP77ccqAhO3brzXWGR/9fJAawxXg +cS/D3ACiggiV1RvNvGjIF1OqVANrtwOfc9r2VvFHP7xOszoRte56oPyn58bYc5Q2SJo uz/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=oEZTeYpi; 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 4fb4d7f45d1cf-6ba37097f69si2517443a12.16.2026.11.20.05.15.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2026 05:15:08 -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=oEZTeYpi; 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=Content-Type:MIME-Version:Message-Id:Date:Subject :From; bh=/3vSbCXGoJZr/Kufc15gYvps4NLHIIMZEIGioT/9gCY=; b=oEZTeYpiIOVB71kiX9Z CoVnchRLQjdk6K61WM1vT9ouEjnMjDO4oyXHgC5aq/55UrP92Zg5GxoTvPvgp+7yVdSs2jQGEQTPY 4SAUjU+WD4PiJg7nCZEsltliedra6E9d6lWwhkPNiSHJwauad5oIDzOiLi27sjDeSqU5Ypw4M4C8k AGg69LB+RIibe7E9L5deUOSIy6BrVb/I+E3M5DF3BSFqZUZhwWptPDyygkM+B+d2hF4bcCQWSlcPa wLYmhRDURNAs9QsxtQEglvVm4c0LZTRPrP80ozicfRctx4+KFC/odDKuCJl3UVXcHMloF+vB67KF8 acYRn6BSLi0KlSg==; 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 1xUOSG-006lM6-0a; Fri, 20 Nov 2026 14:15:04 +0100 From: Konstantin Khorenko Date: Fri, 20 Nov 2026 14:15:04 +0100 Message-Id: <20261120-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v2-0-c85e827c1dba@virtuozzo.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIANhHAGsC/6VPy27DIBD8lYhzl7LUoXZP/Y8oB8DrQq0YBDZKH Pnfi51P6HF2ZufxZJmSp8y+Tk+WqPjsw1SBfDsx6/T0Q+D7ipkUUiFiB6aBmCjC6EKiaQxQ8hw S4FmhaqAQZJqXCLPOI8RMSx/yEikBIfbDh24tGs2qezUZ/P1IvjBnPbRcsuuLyIv5JTvvubvU6 Exgkp6s209V/P5CkBwKUBwlFyAR+eeZI5eK33lZKxPKuv87v1d8HBsLHoH/nlMQBAg1aGHarmt 0+118mpewroHbcGPXbdv+ADnqmAldAQAA X-Change-ID: 20261119-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-e11df3a8c1ba To: Mirian Shilakadze , Pavel Tikhomirov X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4793; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=+rWXP6O8/TjOxpiWLkn4Grg8sjTww8wsBcIaW63ijaw=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBrAEfaHfW35FVeB+LDnaycR7UFrbEsLMWmVheth Yp15pPNXsuJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCawBH2gAKCRBRlgpH+WFc KqZ9D/9ciyznqOX6oPNfFSXAV+BnDW/onl1wOrF64udKI9ZHSc8NGVU3yGu9iHkhAqQVPaLfIUE pMXQx3qxGlAKRX8RYc3YKDWhKWbXxTJHQ6J+rTCKr4qxNLAEGGgJGvd27MTomiq9hITRBolM7iO 7w5faIZkFNswyrDIG6xAMbJn4bc+lL0F4Kn8ZzTwOu8J2+X10C9lq5WSjJZOv6D/aK54jaFcyQg qyOWAEZkHzxpi89PGwy4ySH/n6zE24lQcT+ng0Z7Sg4N8uB0C6i2kuDJ72mecl2Tlv1nvE6EbZU JospGKFx5z19i8+n/BP9qhyeVEgrNnanhadiXkSCCQnlGXtJr5PnZjhnPog2woNwvOrMirjwY1Q 5tgA6TczUEbuTKPCFuqJUhUd+YgUitkuV9WdenCtZva6Wx/q7f54UMTCY8bHkegmzn2ZC/a19fT lMtyAymfy2We6KNde+W58HltezzotHAGv/eowhoVsTi6DlZyDuIxQheX3BXLWBVh16jV5VMqITH wsXgEeSta83WympD9ZhjonG5Ev0bD7yZ3+VmhwDjZfhHZzww7eFErs2tpYzz6g6hCu7QPheqBSE qYZVorFBT5zWQ4bVSEHp1N6euMW4+AJX0MU/s5ymsHOlKhxxYaNdm+4RxZRJ2dMpfFuOXmNFQ1W Z6Eorrse+al97gg== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 v2 0/2] ve: Container start on the 26.3 kernel with libvzctl before 10.0.144 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 The VSTOR-151265 series (26.3) hides the setup tasks of a VE from every task of it but each other while the VE is pseudosuper, and gives the pseudosuper relaxations to the setup tasks alone. A host task is a setup task only if it entered while the VE was VE_STATE_STARTING; one entering a running VE is an entered task, hidden from the container, with the mount limit as its only relaxation. libvzctl before 10.0.144 starts a Container like this: pseudosuper=1, clone the init, the init writes START (the VE is RUNNING from here on), then a helper joins the init's namespaces one by one through setns(), opens /proc//ns/mnt, makes the ploop device nodes and mounts the second disk inside the container. The helper is an entered task, so the first step is refused: Failed to open /proc//ns/mnt: Permission denied Failed to configure disk Cancel init execution Every Container start fails with libvzctl before 10.0.144, hci-8.1's 10.0.134 among them. libvzctl 10.0.144 (vzctl commit 8bf40747, VSTOR-151174) opens every namespace fd before it joins the first, while the helper is still a ve0 task, and the start works; hci-8.2 ships 10.1.3 together with the 26.3 kernel. Patch 1 trusts every task that came from the host and has not exec'd while the VE is pseudosuper, whichever side of START it entered on. Patch 2 is the selftest for the old start sequence: it starts a real VE (pseudosuper, clone3 into new pid, cgroup, net and mnt namespaces, START) and checks that a host task joining afterwards reaches the init's namespaces and an exec'd binary does not. Verified on a test VM with the six Containers there: +----------------------------+-------------------+-----------------+ | kernel | libvzctl 10.0.134 | libvzctl 10.1.3 | +----------------------------+-------------------+-----------------+ | 26.3 as is | no CT starts | all start | | 26.3 + patch 1 | all start | all start | | RHEL 10.3 rebase as is | no CT starts | not run | +----------------------------+-------------------+-----------------+ Patch 2 fails on 26.3 as is and passes with patch 1. Changes in v2: - Patch 1 replaced. The RFC made a host task entering a pseudosuper VE a setup task whatever ve.state says, and such a helper, if it stays without exec, becomes an ordinary visible task once pseudosuper is cleared. Now, Pasha's variant: ve_current_is_pseudosuper() accepts the entered mark too and ve_current_is_host_task() goes. An entered task stays hidden after the clear, as before. - Mirian's one-line alternative, relaxing only the ptrace check, would do for the start: the disk setup that follows it runs as an entered task with libvzctl 10.1.3 as well, and passes. Not taken because old libvzctl runs more in-process helpers inside the VE after START (devices, bind mounts, GPUs) that had every relaxation before 26.3, and one predicate is easier to reason about than two. - Patch 1 verified with the hci-8.1 userspace (libvzctl 10.0.134, ploop 10.0.47) and with 10.1.3 on the 26.3 kernel: all Containers start. - No RFC: the two options were discussed, this is the one to apply. - Patch 2: message and file header reworded for the new rule, the fds leaked on the setup failure paths closed (Sashiko). - Link to v1: http://lore.virtuozzo.com/20261119-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v1-0-06fa0b8994a8@virtuozzo.com https://virtuozzo.atlassian.net/browse/VSTOR-156164 To: Mirian Shilakadze To: Pavel Tikhomirov Assisted-by: LLM Signed-off-by: Konstantin Khorenko --- Konstantin Khorenko (2): ve: trust every host task of a pseudosuper VE until it execs selftests/ve: check a host task entering a pseudosuper VE reaches its init fs/namespace.c | 4 +- include/linux/mm_types.h | 4 +- include/linux/ve.h | 2 - kernel/ptrace.c | 2 +- kernel/ve/ve.c | 43 +--- security/device_cgroup.c | 2 +- tools/testing/selftests/ve/.gitignore | 1 + tools/testing/selftests/ve/Makefile | 1 + tools/testing/selftests/ve/ve_setup_task_test.c | 295 ++++++++++++++++++++++++ 9 files changed, 315 insertions(+), 39 deletions(-) --- base-commit: c1acd2c05aa3ebe0313958e2bd09f60f2040a5cb change-id: 20261119-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-e11df3a8c1ba Best regards, -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel