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 6821F803F6 for ; Mon, 16 Nov 2026 10:47:30 +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 6AGAkJSh022698; Mon, 16 Nov 2026 13:46:19 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AGAkJSh022698 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="A4Eush9e" 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 6AGAk3mv022648 (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 6AGAk3mv022648 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-492b5408dedso1805227f8f.3 for ; Mon, 16 Nov 2026 02:46:03 -0800 (PST) X-Gm-Message-State: APuU4Z9U4NzNxJUE/b+ZhbfwmQYJLmzbkM5hWrKImnO747WFT7zfUtXJ Ym93Ai/LT5QwdfZzepSN5HmG+mzkdmPsLquRyTSNQBCnyWMrxQR+2jykSOzZ8J/sY3mITCt4GXN rJUAA35MdEe9DavZUEmfqqyDCUo4d86xbH4AUOnRx0lrgErWaeKr3qg== X-Gm-Gg: AZFdTZdpEpG9QH1e92GdKWmLXbe+eId5i+qiUEbsxjFaLjLB25ufWnToUX8XWZf1RYp rld/zhAAFub7i708MaQOUw9dnpDinIocFOLP1fYH7m6hqJUcuouuYetWhBbqJJnrUC1V7ApZQXx NGPnpybCinrHybNTZejtglxv3fvNhGM06JCdAbbA0A3DgnUEDb58L/Q78aUlQEBcerEiBYuHXHU qyhl/C52SXbnntNrKNNP862leYxiXt4x4U8u/zPRV7pc6VxLmN/prqqcs2LTKCza2QRkdGBEkx8 FD9eRjWa9eI/Ag4Geq20w5URimS2s5MulhVSwFgPSYP1MACRPglfkHrY3q9r5kfPW61DBChAVV7 fE239s2KyufFpOoDfXdUMr9L8jovr/A== X-Received: by 2002:a05:6000:18a9:b0:498:88f:14c8 with SMTP id ffacd0b85a97d-49c73259e2bmr24573191f8f.9.1794825963158; Mon, 16 Nov 2026 02:46:03 -0800 (PST) X-Received: by 2002:a05:6000:18a9:b0:498:88f:14c8 with SMTP id ffacd0b85a97d-49c73259e2bmr24573121f8f.9.1794825962595; 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=rGZ3AJhPcOs2fSzXRUVZ9O3CklPfAZtfv9FDmYsXwrDBmAITYYkPmrjFtgR667AckC jJlhngtWLt+ojJuRVHEyCXx4jOLpYJlNxW1N46CGIihJoEVFjNRWY1GrgRVVkJqsdhHM LDb7h4vgFp70h0s5LFqLga2l6aRny/xVeUW0fOMR00jzGOu3zk7tveOPgt9g9rh2zkGE f7qHB9wq03CZexaikNxBtTL9azR4dlTGb+GsjY0FxAWDmvtkW7CDJ2aCDrO7DdrZkCof T1vlCC/U0DCOJt4oDWYdOy697mx0tT7Sa/WsdsIyU9wYSCmAdGapiEhytj5Zj+W0H0Ay 2VyA== 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=ZoY0PB7IqW6mkCYNEvH+rfrz6n4hk1STfJAOMrEdKNc=; fh=wpoNUURlquLpJK/14Kny0oMIYkY7mYwjJ/Ils9UT2kk=; b=rkEZ77JiSaEE69GxgntMz+jYuqh99d08dnn3UroJc72Iekn1uUWpD5xD5Tq3+Brzeu v736Qnp8NXVRepS/mU/VCLC5XSOBYdY0F6h1CjbqQGrIINa7Ml4+6pGg+1NoKsahbCsl Air+Ua6ObRzKEtV7JAKLo43kKK7URrHpq7q/zVn+AF+BXRuby8kJHz4/gfAeiKJi5sKr FfPdes+uIn6H3QtElyh/lVPhSv2BQ6SCtp9D3dgHr1sSXkQWPGdMXlO4dkelmgUEH1uG C4WFudpc5K7P4nF1HbUR7mqA5iOOBA0rYwFlmUGBUmXXVcW8cSEYPIRvuY7SGQizns+V 3MHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=A4Eush9e; 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-4a1be98cfccsi6459604f8f.301.2026.11.16.02.46.02 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=A4Eush9e; 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=ZoY0PB7IqW6mkCYNEvH+rfrz6n4hk1STfJAOMrEdKNc=; b=A4Eush9e7nHB PeiR+cxKgROg90+i81BjM8SxBRvHo2ol2js7PxfzM9g00KGGjD+1aBXoiv0vfN81qgTcCNoVtC8km C9BMSBOLb/RhjdJR4zIsO+1rlCdjGHy/ZhDnvAfCosaNnzxHzEG6T+sLOgdOAFr5emW61PB2B2NqT YG9kR1ZNryjJULhLAkpcApD1ABLHtta6kCdacWNJqvrDL7PmbnZ3TN8G6mS8rkaBoGk0b4qmhiZl9 EFK/rBW4b/24k/37SHELKXwlsz2UV0/V1+RcSg9IRKVQeBq+iBwkaNGfJNWighPWd9cnv+4cXtUOA gAZuhlqNqLV//bkv9ycOEA==; 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 1xSu9b-000IkS-1H; Mon, 16 Nov 2026 11:45:54 +0100 From: Mirian Shilakadze To: khorenko@virtuozzo.com, ptikhomirov@virtuozzo.com Date: Mon, 16 Nov 2026 14:45:49 +0400 Message-ID: <20261116104552.102938-7-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 6/6] ve: give the remaining pseudosuper relaxations 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 may set NETLINK_REPAIR, set its CT fields with prctl, write ve.features, ve.failcount, ve.pid_max and ve.aio_max_nr, and pass the legacy device cgroup check. That includes the container's own binaries that vzctl and CRIU run. Use ve_current_is_pseudosuper() for these as well. Feature: ve: CRIU support https://virtuozzo.atlassian.net/browse/VSTOR-151265 Signed-off-by: Mirian Shilakadze --- kernel/sys.c | 2 +- kernel/ve/ve.c | 8 ++++---- net/netlink/af_netlink.c | 2 +- security/device_cgroup.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 80f8b9eb17c3..21650d331a42 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -2324,7 +2324,7 @@ static int prctl_set_task_ct_fields(struct task_struct *t, unsigned long arg, #ifdef CONFIG_VE struct ve_struct *ve __free(put_ve) = get_task_ve(t); - if (!ve_is_super(ve) && !ve->is_pseudosuper) + if (!ve_is_super(ve) && !ve_current_is_pseudosuper(ve)) return -EPERM; #endif diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c index f7f802dc7ffb..ebb52a1b678d 100644 --- a/kernel/ve/ve.c +++ b/kernel/ve/ve.c @@ -1075,7 +1075,7 @@ static int ve_features_write(struct cgroup_subsys_state *css, struct cftype *cft struct ve_struct *ve = css_to_ve(css); if (!ve_is_super(get_exec_env()) && - !ve->is_pseudosuper) + !ve_current_is_pseudosuper(ve)) return -EPERM; down_write(&ve->op_sem); @@ -1128,7 +1128,7 @@ static ssize_t ve_failcount_write(struct kernfs_open_file *of, char *buf, const struct ve_failcount_entry *entry; atomic_t *fc; - if (!ve_is_super(get_exec_env()) && !ve->is_pseudosuper) + if (!ve_is_super(get_exec_env()) && !ve_current_is_pseudosuper(ve)) return -EPERM; for (entry = ve_failcounts; entry->name; entry++) { @@ -1228,7 +1228,7 @@ static int ve_pid_max_write_running_u64(struct cgroup_subsys_state *css, struct nsproxy *ve_nsproxy; if (!ve_is_super(get_exec_env()) && - !ve->is_pseudosuper) + !ve_current_is_pseudosuper(ve)) return -EPERM; rcu_read_lock(); @@ -1446,7 +1446,7 @@ static int ve_aio_max_nr_write(struct cgroup_subsys_state *css, { struct ve_struct *ve = css_to_ve(css); - if (!ve_is_super(get_exec_env()) && !ve->is_pseudosuper) + if (!ve_is_super(get_exec_env()) && !ve_current_is_pseudosuper(ve)) return -EPERM; down_write(&ve->op_sem); diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index f686e6ea30ce..e808d8ae3e1e 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1695,7 +1695,7 @@ static int netlink_setsockopt(struct socket *sock, int level, int optname, #ifdef CONFIG_VE { struct ve_struct *ve = get_exec_env(); - if (!ve_is_super(ve) && !ve->is_pseudosuper) + if (!ve_is_super(ve) && !ve_current_is_pseudosuper(ve)) return -ENOPROTOOPT; } #endif diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 1629896b2ea1..fdeb136a3bec 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c @@ -931,7 +931,7 @@ static int devcgroup_legacy_check_permission(short type, u32 major, u32 minor, if (!rc) { struct ve_struct *ve = get_exec_env(); - if (!ve_is_super(ve) && ve->is_pseudosuper) + if (!ve_is_super(ve) && ve_current_is_pseudosuper(ve)) return 0; return -EPERM; } -- 2.43.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel