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 111C3803F6 for ; Mon, 16 Nov 2026 10:47:29 +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 6AGAkGUB022690; Mon, 16 Nov 2026 13:46:17 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AGAkGUB022690 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="Ows8Hr48" Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AGAk2lV022644 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 16 Nov 2026 13:46:03 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AGAk2lV022644 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-4901562b819so3058163f8f.3 for ; Mon, 16 Nov 2026 02:46:02 -0800 (PST) X-Gm-Message-State: APuU4Z/IG918NKY6x99hZirWpg7yHJaTaeFwzTe/xo0CGycI8W4049sH yHanlXZKZ6aQN/IXrHpeBdGoWsfNeblryQ61ZYhGvy/LPD4uvK5/w51PkZGkKJq3ZsOX6wjjPFX aP0ce3/k4JvtRpDF55f4TNcoCQ4dgmaqvtqsQooiLSzO++LdQmWmjEw== X-Gm-Gg: AZFdTZern1Ok9LcOuy0K74kpLJ47Aiuk3fh50jsmgs6sRDCu1o7fJ6MtAnKwb4zO7pQ PZyF7lbJYhnhJ5A8bSVnF0bUES46Fb7CCm62dwHj3dGSphjH6l2Zh+7Z9Y9g2BVDpGJr4+ojNRE 803n411ioHxUZ0dnObazpEi5HYyBhal2mTbapVBmZmJ/NmoAHW6TSIRwbOTusZKlBFuRbYbKc24 SeERj+iiiUUfcfYE/M7MPldl+qgDTo/tQkUkBYgqkwAqOb+WajDNusR4445thdYUlhrRAr2LB/c xTN/CO1NM769CavCtWBVpDge9HcDPjglOGesotDLX3LgxyKsF8NHJvPLuJt6RD8DsGO9qW8siIo 8+Z9MzjLlnpLozlOZ06pdeR9yZ+OC X-Received: by 2002:a5d:64e4:0:b0:488:7df9:3898 with SMTP id ffacd0b85a97d-49c7211d955mr20477968f8f.56.1794825962550; Mon, 16 Nov 2026 02:46:02 -0800 (PST) X-Received: by 2002:a5d:64e4:0:b0:488:7df9:3898 with SMTP id ffacd0b85a97d-49c7211d955mr20477929f8f.56.1794825962052; Mon, 16 Nov 2026 02:46:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794825962; cv=none; d=google.com; s=arc-20260327; b=Am633umur3bQ3cp1QrECLBMVp7Tjp2yluidAlT8OzGjoBnW7GZggkKb/lYGeMKhSDx bE3fE4U01fA9CmBvsd2rRhrca6ojTDkYkpNBXcxN/4J65M3aRaV9sfU9fZ1JMtSAvgqx xlHEGSf0htMBO/2mhB/ifzC1ZTsXqbiPWkVL/IqhIbEQtg7RSwmD2N9/UxppvY/JRbcQ kRRHFobRsh/VSSJhr3NNS/VDasOQdJ4B1LLhdx0wRzdszws+MCfU62Quaim9jCi4B1pv G7Lw8CMXTvsAJeogS9hxY8AblLKwfnCyWfALK6xp1n4wMl5ih/X5xmqNKzqjroavkPTO zvTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=tgupYgPcuGGduxLSqAx2eYQ70Zq/HCVnYJqbf1PCRdo=; fh=wpoNUURlquLpJK/14Kny0oMIYkY7mYwjJ/Ils9UT2kk=; b=DRXLH5Y6TXeNFSIf9n3npX0RW6GkSbz4hHA5nRo4Fupk6aFwEHeHnVC7e7Z/4kb9rd jrMQPt4IuHTeEJx60Ym2ptCB/jOzZLgxqLWMyDqv/+uxJ8umt8UA4oKYbsAud80lFvph Y/w8jV9j0G2TpfE1ECIn5BUVtFvBvjAn2QVuXpE+XkaBpN7OKoQm9MHa4S9pp2iXe2nc klm7gv+p4bxQ0ELhZYXUIQL4enzSCu71NrEA183WT3JSSCB2H4/aqjgKFa9No5iWlJA8 L1ljy2krpl5ENZDVUcqa7EO1tnZK13c/IzQZJulHjTE6ZP0p4XSgJglDqXd9PVXDuwbG HyOg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=Ows8Hr48; 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-49c64ee0a9dsi19092503f8f.443.2026.11.16.02.46.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 02:46:02 -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=Ows8Hr48; 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=tgupYgPcuGGduxLSqAx2eYQ70Zq/HCVnYJqbf1PCRdo=; b=Ows8Hr487966 B8i7HYcRGVZsOiLkNJaeOlun2HVgU4Vjr3usikUMvOAv6G/VBpWsnw75FptVPXCtgiglzyHC7nZMJ pzPQP9GNZ2fwSeTj4wBVmMGHzESBB1znD3acJk8u8sKGXqLbsJJrZSKNwE3g8O8//ahcRe6b3h0La Uo0rRzFzHXD/iZ/07TbVdGQfNOKNIuwItd8Xvdi9bMnFDbJv64xVHbKNplWA5XRwBfihWbrjdsgR2 cDVDGQ9tcmGjOk1Eg9hrSBStgpPfAf1cc2KKiS/SRrQVsXYoPikgKvnFSUVva2swfJlYUoKvQu6IP 9lZHHcJTPcL5DgX1fBVR7A==; 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 1xSu9a-000IkS-2a; Mon, 16 Nov 2026 11:45:53 +0100 From: Mirian Shilakadze To: khorenko@virtuozzo.com, ptikhomirov@virtuozzo.com Date: Mon, 16 Nov 2026 14:45:48 +0400 Message-ID: <20261116104552.102938-6-mirian.shilakadze@virtuozzo.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261116104552.102938-1-mirian.shilakadze@virtuozzo.com> References: <20261116104552.102938-1-mirian.shilakadze@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH vz10 5/6] fs: give the mount relaxations of a pseudosuper VE only to setup tasks 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 VE is pseudosuper, any task in it skips the device mount option filter and the VE mount limit, including the container's own binaries that vzctl and CRIU run. Use ve_current_is_pseudosuper() instead. The mount limit also lets through a host task that joined the VE after it started, such as the CRIU helper that mounts proc for a nested pid namespace during restore. Without that, restoring such a container near its mount limit fails. Feature: ve: CRIU support https://virtuozzo.atlassian.net/browse/VSTOR-151265 Signed-off-by: Mirian Shilakadze --- fs/namespace.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index d622d9b72d32..20a03419bc0c 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -3230,7 +3230,7 @@ int ve_devmnt_process(struct ve_struct *ve, dev_t dev, void **data_pp, int remou * we don't check for allowed options filtering, since * restore mode is special. */ - if (ve->is_pseudosuper) + if (ve_current_is_pseudosuper(ve)) err = 0; if (!err && !remount) @@ -3255,7 +3255,7 @@ int ve_devmnt_process(struct ve_struct *ve, dev_t dev, void **data_pp, int remou * the way userspace tool restore container * it might be nonempty as well. */ - if (ve->is_pseudosuper) { + if (ve_current_is_pseudosuper(ve)) { err = 0; } else if (((char *)*data_pp)[0] == '\0') { err = 0; @@ -3330,7 +3330,7 @@ int ve_devmnt_verify(struct ve_struct *ve, dev_t dev, char *opts, bool new_mount bool found = false; int err = 0; - if (ve->is_pseudosuper) + if (ve_current_is_pseudosuper(ve)) return 0; mutex_lock(&ve->devmnt_mutex); @@ -3367,8 +3367,16 @@ int ve_devmnt_verify(struct ve_struct *ve, dev_t dev, char *opts, bool new_mount static inline int ve_try_reserve_mount(struct ve_struct *ve) { - int ret = ve_is_super(ve) || ve->is_pseudosuper || - ve_is_super(get_exec_env()); + struct mm_struct *mm = current->mm; + /* + * A host task that joined @ve after it started, such as the CRIU + * helper that mounts proc for a nested pid namespace, is not a setup + * task but still skips the limit while @ve is pseudosuper. + */ + bool host_entered = ve->is_pseudosuper && task_ve(current) == ve && + mm && mm->vps_dumpable == VD_VE_ENTER_TASK; + int ret = ve_is_super(ve) || ve_current_is_pseudosuper(ve) || + ve_is_super(get_exec_env()) || host_entered; /* Ignore limits in ve0 and pseudosuper cases, but still count. */ if (ret) atomic_dec(&ve->mnt_avail_nr); -- 2.43.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel