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 44568803F6 for ; Wed, 18 Nov 2026 10:38:39 +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 6AIAbS0J023452; Wed, 18 Nov 2026 13:37:28 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AIAbS0J023452 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="ZsvmE/jB" 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 6AIAb3X6023397 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 18 Nov 2026 13:37:03 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AIAb3X6023397 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48c6a1d4034so518303f8f.0 for ; Wed, 18 Nov 2026 02:37:03 -0800 (PST) X-Gm-Message-State: APuU4Z9G1hJt2TDgoiY7mtK+JVSvVfZ7zd7parluKcLe/OQnxlCXlric CKIEWv+ZcyQcdafG0G3TAJeKQo+7TtSwohdQ6bq4bA3AHg9bMMn2+/Rk9VBYvq64wcmKc5fyENG +kTnnuvZwud9BxEmgGkdcQOdi7excJFMXCHhabvGVMq7vTsOHH5HkbQ== X-Gm-Gg: AYBFou2yhyXr30++R8+qcrbDRKKbo8JfxZ6sI5mCyQSbr1w6fMc8sy6rxNVj7idY3uf JryzKjNoFjXjMZQ4Ssb0ERnS9DngkQm0heeZMD6IUv8UQCc0hyb0QW/5lrRVxx9z8dzEwpJNY/t mJb0Ph58qjiQJN2nXs8TrYuEyLGZIo3HRB7+E9scJjER2RqfTq+gctUy3/u5EtOP0FLrcB6TruV J8kEKUgrdulORhUtE3MJPXoksevwo2DBHrNl6c7qklewd6E0vbg5nJzqOWsKUfQy/A+BT31n47v mc6wm26mFhKWx6gxpLBrNf2hFhusO1XJwlye+uQmqoHWYfpm2JJ8dntgXmGK7sbzqYlODIAxwUf 6NeFRhnez1sjtZqxSlqlu5h2XfSVw X-Received: by 2002:a05:600c:4e56:b0:4bb:7581:2bb9 with SMTP id 5b1f17b1804b1-4bb7da3003emr37685765e9.22.1794998222921; Wed, 18 Nov 2026 02:37:02 -0800 (PST) X-Received: by 2002:a05:600c:4e56:b0:4bb:7581:2bb9 with SMTP id 5b1f17b1804b1-4bb7da3003emr37685295e9.22.1794998222434; Wed, 18 Nov 2026 02:37:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794998222; cv=none; d=google.com; s=arc-20260327; b=PmGYyEYR5//dmPXsQWvpn6ByPSwB94zj3MV4NhvLJkmV+f0kqJOvhR7yW/g0/igPKq Jmco7AaxWkCZYK/KnSIL16BWE3IUvj5Lq/rhqV+ktHn7Ou7INMKe8KTxmHft+V6jKSYe jI7D6aMIbqjfAaR9h6gBRg+1EMrur9vgG1SIosyRTMdv0dOOgoJ0DlfCLJZmbp1pLYnc bBbqetuGcHmZosdjUfZUM+qRRVqWRy9JQmsrEzjZdwUF48B15uShVTdDzFq+qTYPIXDU R1SGoRfUrt4KoyMmEcK7r/XAkMFRRZrwXa5384u6NlXJyOfhfPDHOvTu+AR5fjqe23GG FV2w== 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=0isvIWO1vd8rBJmKN47p50lpvjQKDt23FYbALPPPs4g=; fh=wpoNUURlquLpJK/14Kny0oMIYkY7mYwjJ/Ils9UT2kk=; b=KhbpgFHobCjiHon6EbCOnG3OO3GCQVIehyH5A6+ZHQXj0S4kU269vg5wN9WOmGhb5I 1tGEe7i8UZZFHkEy1pW6Ae+UuFpKmjWeVYG8pUVIIiGN9Q/TwOm0f7XsMTaIze4URxG6 gohtGjDPCd13WDTU6fQozbZgMd1JnDct0zcXzVCyN0gxhsu+dGRzuWTgPqKWZhnLd92O zzMksvdmSBcU0U9WnD36aSzHKaKJw1FENpbo2rOcYgUVNh8kTHxl0C/3wEZisNTGRfUw DuTmgh1d2FZ+l59lnwEkR9LgdhJM1lJeyULfgxYP6kokLHNUt7w9JL87S8teU4xSL63z moDA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="ZsvmE/jB"; 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 5b1f17b1804b1-4bb7d000f7fsi43334775e9.0.2026.11.18.02.37.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2026 02:37: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="ZsvmE/jB"; 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=0isvIWO1vd8rBJmKN47p50lpvjQKDt23FYbALPPPs4g=; b=ZsvmE/jB/e65 vqCbzeNrd34UfXF1xjuvMx1n+OIIbak4I4XHMkS2xn0/HbdLV9++OPRs1WI2eS80oz90Aw9imLJ6H GSICcgwjZVi2uZag5UHIdCjNKeGkDC5/f/742/ynfL1nnQf+ByIcc54lKY7FhYTTVpchPIIZzoDe5 ke29pmLrofqRUcOWGh1O87QnblAffphUjoj2f+H9VYkGhGHC3REbAMgPo6hIQRSWTr9lKUklyukIU iDoIqnYDAD0cEcgPDKvcqh8v1r2tck2lWlg5fP5tDOPREt+1S7Tpj6gDYBxp1ZiQmxQAOe9AS6Jhd runQQFYDzdpvoGUjgGmI2Q==; 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 1xTcxw-001uKo-0c; Wed, 18 Nov 2026 11:37:01 +0100 From: Mirian Shilakadze To: khorenko@virtuozzo.com, ptikhomirov@virtuozzo.com Date: Wed, 18 Nov 2026 14:36:38 +0400 Message-ID: <20261118103656.363171-7-mirian.shilakadze@virtuozzo.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118103656.363171-1-mirian.shilakadze@virtuozzo.com> References: <20261118103656.363171-1-mirian.shilakadze@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 v3 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 | 8 ++++---- 4 files changed, 10 insertions(+), 10 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 e5b152a83225..0483f9f6d30a 100644 --- a/kernel/ve/ve.c +++ b/kernel/ve/ve.c @@ -1066,7 +1066,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); @@ -1119,7 +1119,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++) { @@ -1219,7 +1219,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(); @@ -1437,7 +1437,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..b0ef5f9380d1 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c @@ -923,15 +923,15 @@ static int devcgroup_legacy_check_permission(short type, u32 major, u32 minor, #ifdef CONFIG_VE /* - * When restoring container allow everything in - * pseudosuper state. We need this for early - * mounting of second ploop device. Still, don't + * When restoring container allow everything to its + * setup tasks in pseudosuper state. We need this for + * early mounting of second ploop device. Still, don't * change behaviour on the ve0. */ 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