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 68FDB803BB for ; Mon, 16 Nov 2026 10:47:17 +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 6AGAk1sp022629; Mon, 16 Nov 2026 13:46:01 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AGAk1sp022629 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="NShh1yNz" Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AGAk0TN022619 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 16 Nov 2026 13:46:00 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AGAk0TN022619 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-490d2ac331bso3128974f8f.0 for ; Mon, 16 Nov 2026 02:46:00 -0800 (PST) X-Gm-Message-State: APuU4Z89mRS5+3C4CKMT0Syqb7vdwoBhzJRLrC4EwlN7Wpg+W6AKUXe7 rjTuElHVVTvdCQj++UI7UtGThTn8aePUq4V8/56hovJlqL1Za5pi3UrXGzNm086KyieDklt2UqO +tvUbYOqRk0Rmg2KxcTq9Goqwgyig3pAnM1weHtzGnWNBJXn4TingQA== X-Gm-Gg: AZFdTZeiZA9KtMoipzotANKHR1tbwPzqH2ScfariWQX7cCpbIjloRC9TuzTRPLiNqZj mMH5b1aRuPzDtsPvttb0tHfYYBQ9WRQDDYhAHpGWAhbV1smkwqkb+DPqAMk76dZIaP3X0JiijM/ ez4iwL/DQU0f/H86rEBp9WRuUv051VQbDTxek9I1xyvCcrvA4yJBUxC1mZMrqgX9qWAVhAZQtph 83wbO4nUe0wWJhEkK4iPgu9RrYyyR+xgU2tyuGhi9dm8ky5kd0J2J0HZ47w8cc3jNuiSw0h6/RT cwcoQEyDk3niW9Pg5elsw/RW2SwUlVbQZkf/FmJ5tHUj24KNnayVIFKXFYfChZHoc/P1FeeRoHW S7lrzkVGHWFbQ3xy7q2ZtGXqBeFel X-Received: by 2002:a5d:6f18:0:b0:48e:669b:76e9 with SMTP id ffacd0b85a97d-49c72ab1190mr18781376f8f.47.1794825959978; Mon, 16 Nov 2026 02:45:59 -0800 (PST) X-Received: by 2002:a5d:6f18:0:b0:48e:669b:76e9 with SMTP id ffacd0b85a97d-49c72ab1190mr18781324f8f.47.1794825959479; Mon, 16 Nov 2026 02:45:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794825959; cv=none; d=google.com; s=arc-20260327; b=cuC3PTT/v4G6IFTYBeQgBnzv9kYG7Ov1DIOpeY7GTXw8RsVzH+T2moRhNT8TLVPHwJ PXuh0wgjE7sv95fxotPG+qvtx4l3lOowEniGTJq5HZ4KB828X2a5w7x3inB6HKOIfFBy bippJe3ZR8Upg9CLVzQ2srmJ2OL/MtFC0WD2HC8nRnIVBzvwKCj4Js6FLtVFmSbAM7h+ 1+t2h7pexGR8U/O0L3Gf5HjgopBWim3rvx0DcyBNNwGr4YiGGxqkI5z12O7MDN2U1v5g 2fw2prweU/Gmmd5rD6b8g3vgT6DcP0OEJdzR7gYXhKu8RgZrXC/l/T/ToiUdmkxcVzNk WBpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=/kT0aP9g6rhEM8AmczrWY74uS3RTVS5SonrJd6Hg+Dk=; fh=wpoNUURlquLpJK/14Kny0oMIYkY7mYwjJ/Ils9UT2kk=; b=p3dDxLjG3zYE/wuMTh1uhxSLa+L1xCmfQ2JiZtpFtZC4FMTkqk05kkbIqfQ2CqtztH 9rlr+f4Wn9F3eYPq59QO2stP/a5yiIIso+D/T0I48EXCj/O6+tFF1sYjdM7+W7ayTlr3 sG3va8K9HTfhzuMrptxWfVdvTk5C+eU9sIKrg+MW/uRxuvL8BVLE/L5RdpJuJ6oojSuH 4ohHWSF/W3wMW4kHivIgCVJWPQNimPUSuC9P7eoLGPJOYWuIxDBci8r2SNGciOB77qQo QDEa+abtw48B4PDo8CXL+OiHQgdRBVEYXxJTSJEy2vgz/SzG8t+evpynp9Z3c+kDvDKB bJyA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=NShh1yNz; spf=pass (google.com: domain of mirian.shilakadze@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=mirian.shilakadze@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 ffacd0b85a97d-49c64a1581esi22000530f8f.383.2026.11.16.02.45.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 02:45:59 -0800 (PST) Received-SPF: pass (google.com: domain of mirian.shilakadze@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=NShh1yNz; spf=pass (google.com: domain of mirian.shilakadze@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=mirian.shilakadze@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=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=/kT0aP9g6rhEM8AmczrWY74uS3RTVS5SonrJd6Hg+Dk=; b=NShh1yNzqxHa AVo8WhFz9zEfkncCkRmTxjbC6DgKazjk+aIy6NLEEfm28dkPwMfOr/fVYkplXsD+07lzzhEmfVrJy GCivzMdXAP2chAS4UdC1o7XPkm6HgTeAR0hs04B5kmh5coYLE8TBXJlUTqcecye3CskGuUNQCoSeC d5VuN8ffZRiR1FUS3ukyurQNohypOYDd1ltJBBDjQZViNGl+Aia3jZX5j3Y3uJVD6q7NF01VeJqqi xVVSq4LtFqtrT3zH6tx+mQWn1f1j+YQwf6E3i5SRhUg+6I+hUKvf4EqzPR+MN/40QOQBakbj7nc37 jmsd+0WbH/DjGvLF6K+5cA==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=localhost.localdomain) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xSu9Y-000IkS-0D; Mon, 16 Nov 2026 11:45:50 +0100 From: Mirian Shilakadze To: khorenko@virtuozzo.com, ptikhomirov@virtuozzo.com Date: Mon, 16 Nov 2026 14:45:43 +0400 Message-ID: <20261116104552.102938-1-mirian.shilakadze@virtuozzo.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH vz10 0/6] ve: give the pseudosuper privileges only to the tasks setting up a VE 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 While a container starts or is restored, ve.pseudosuper is on and its relaxations apply to every process in the container. The container's own binaries that vzctl and CRIU run in that window get them too, such as quotaon at start and the tee that vz-rst-action runs at post-restore. Such a binary can rewrite the container's root memory.max, skip the mount limit and the mount option filter, use NETLINK_REPAIR, or clear pseudosuper early. During a restore it can also open /proc//fd of CRIU's restoring tasks and take CRIU's log, its /proc fd and the transport socket. This series marks the tasks the host sends into a starting VE as setup tasks. Fork keeps the mark, exec drops it, and only a task coming from the host gets it. - 1/6 passes ve_setup_task() the VE a task comes from - 2/6 hides only the tasks the host sends into a VE, in any state but starting - 3/6 marks setup tasks and lets them be reached only by each other while the VE is pseudosuper - 4/6 to 6/6 give the pseudosuper relaxations only to setup tasks: the container's root cgroup files, the mount filter and limit, and the rest. A host task that joins the VE after it has started, such as the CRIU helper that mounts proc for a nested pid namespace, still skips the mount limit. Once pseudosuper is cleared, the restored processes are ordinary container processes again. vzctl and CRIU need no change, the vzctl start path was already fixed under VSTOR-151174. Tested on kernel 6.12.0-211.75.1.24.1.vz10 on VHI 8.1 nodes, vzctl 10.0.148 and 10.0.159, criu 4.2.1.15 and 4.2.1.18, stock against patched: - a probe in place of the container's quotaon and tee: on stock it reads the fds of every restoring task, restore.log included, sets NETLINK_REPAIR and rewrites the root memory.max, on patched all of it is refused - the same probe gains nothing by moving into a nested VE and unsharing it from a vfork child that shares its mm. With an earlier version, which marked any task coming from another VE, it gained all of the above. - a container with a nested pid namespace restored with its mount limit lowered to 10: restores. Without the exemption in 5/6 the proc mount for that namespace failed with ENOMEM. - a host task that joins a running container without exec stays hidden from it - after resume the container sees its restored processes and they dump core, and start, stop, suspend, resume, a second disk and a container at its mount limit behave as on stock - CRIU zdtm in the ve flavor, with every userns test forced into it: 440 passed, the same 5 fail on stock with the same errors - vzctl pytest 10.0.159: 1377 passed, 0 failed Mirian Shilakadze (6): ve: tell ve_setup_task() which VE the task comes from ve: hide only the tasks the host sends into a VE ve: hide the tasks that set up a starting VE from the rest of it cgroup: give the CT root file writes and hidden roots only to setup tasks fs: give the mount relaxations of a pseudosuper VE only to setup tasks ve: give the remaining pseudosuper relaxations only to setup tasks fs/coredump.c | 2 +- fs/namespace.c | 18 ++++++++---- include/linux/mm_types.h | 4 +++ include/linux/ve.h | 10 +++++-- kernel/cgroup/cgroup.c | 4 +-- kernel/ptrace.c | 23 +++++++++++++--- kernel/sys.c | 2 +- kernel/ve/ve.c | 59 ++++++++++++++++++++++++++++++++++------ kernel/ve/ve_namespace.c | 7 +++-- net/netlink/af_netlink.c | 2 +- security/device_cgroup.c | 2 +- 11 files changed, 106 insertions(+), 27 deletions(-) -- 2.43.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel