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 B8CD5803F6 for ; Tue, 17 Nov 2026 10:15:44 +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 6AHAEScp007958; Tue, 17 Nov 2026 13:14:29 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AHAEScp007958 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="xZACXuhf" Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AHADbrv007900 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 17 Nov 2026 13:13:38 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AHADbrv007900 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4ba078f26f4so28595305e9.2 for ; Tue, 17 Nov 2026 02:13:38 -0800 (PST) X-Gm-Message-State: APuU4Z+ZsHEqy/0Sxl0INnyuai795FfTNEimPGJUngzaB4JCvKTbycoP 2mm4Kn6fT/jCKY2krozCqRUO8aQGRZLB9ZgouB+a1M1RYnpN5nLIpS/lTf4S6d7g8EsPYKJba7P rCIqR+bi8GpiLYHYVDgWpY8uMm/ckgxywiP/aM+auTxCuKtU4HXr72Q== X-Gm-Gg: AYBFou0gpH9tOEOkdN8IdoTOWbiv4wcrFc/cX4toF0+L0jC69EcmuByo2siVvlpVhqX I2cffHxnkpd+ieDgxJIYKvX1tQYHWXxj3Cjh7WkCUyVYVCKr6XjUQdGLKpmG1HTdWNl9DfSgOGF vS7niBgoiEU6t/jE1B3++/ys+3RmZBwayNSZT43sZDvTYlMsPsy7iVxCiil7jJ9OgIPNGsJ8xxX O+m/YTJ8RWsmMWclHkOJH5LWRcT3S8Gsv/qAmFHqhSeHkz2h0qIBprOMmR1LTBBe7SlPLO+z/wN 2lkpuFVfA/n/KUMgrdfBAax+/lMp9OVCXUumIFcvffR6kepW8pRyAZzqXU3qkTZAsY23WtczoYT +qqFYCotK4WyEQZTMl7GMPC/mnsl5Og== X-Received: by 2002:a05:600c:6091:b0:4bb:6a2d:b426 with SMTP id 5b1f17b1804b1-4bb6a2db60amr159054655e9.1.1794910417515; Tue, 17 Nov 2026 02:13:37 -0800 (PST) X-Received: by 2002:a05:600c:6091:b0:4bb:6a2d:b426 with SMTP id 5b1f17b1804b1-4bb6a2db60amr159054255e9.1.1794910417091; Tue, 17 Nov 2026 02:13:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794910417; cv=none; d=google.com; s=arc-20260327; b=VkFbAPHa8dg1/9mTBKBG74VejlnIZVCfXI5xdGI8owbTDpsn5KVRH5UzIHaOWJ53d/ dJLLhHK/yfacrdM7U+5ZsGgso6PsqxRiZDFZpMwcda/Qed893Zf65bruiRq0+f07dYL0 1MuzdF61hSDQHtCO6EaIDOMPxkHj4/cjf4NCgzXXNjCTvp5sljmxGJF/radeqlw0dbU/ WEQq6OBCRWIiHwf4BV825nThj1W3fse9Hf35ccXJBQJ2pIsr/IiDkONFbZaQwg0lgaiw o1TPAw1J3Jr2LJCY94NWzjm9mdTlAB/8Dw44NwZc49IxHYdduj6H9jIrCv1zLZm/nPHY f9Eg== 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=Kj9D52sYaMfGxBxN2Fgmo1GOu8maCIaLcFrbnKu40Ec=; fh=wpoNUURlquLpJK/14Kny0oMIYkY7mYwjJ/Ils9UT2kk=; b=Vqspt/UzcpoGO9QPKwGmq3cDYt+mp9iyj+mrosjOmg3HeRMJX4qSBCgDEOPJqVxzBc A59tI0uMrwUDFMvgg1Xpc4M+2blEp6u2K6Eoilb8DOblT8KUYlMXQEX/XFkXeb4nhmkR Jh6hwVTHPzB3zAH8a1KWJlgOreSZJbz8pxn0PI5THZ55RrrWMoQQ42j9ir5YuR8c6rq+ ia+IFO56reyDzN21bijM5azDrEhInqsDf5hBVusb8C/H+F6zLoy5Z+qZgm3j4FDWwpeS mgizmXXrdJzH7pCt3ST2AzED3g0Hi6I9UKqyaiXJ7Ma5wGyVV2TbFGX3qjUSPJ9TyS0N OVoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=xZACXuhf; 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-49c6002141asi25846573f8f.26.2026.11.17.02.13.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2026 02:13:37 -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=xZACXuhf; 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=Kj9D52sYaMfGxBxN2Fgmo1GOu8maCIaLcFrbnKu40Ec=; b=xZACXuhfKnus sGxr5jGUJo1bWvUcCaE2qAcq0ByFkB2YHkrw27+9942Zq0KZwUyrPgmJ5bsTEmFDA9bSp+vobt4s0 Ozl0xfevku0H0/0H2UC+yuLVdFNn/LXKcQR+/mPY3XpE/Nayts9rkBzr/QNFhJqdz0Glh3TZ4xoai hRfRxOz7eisIACZ8dLV4PQXT/ZF/DkrGisLzW773iH+e4c3O9dSEtxfp57KEKD7WqtP75BKdz8CTM 8Pu9Vr/YGmJeEyMTpOVPTZqwLhvYeKMzRkeynwubOQ9vsnrREDP8tvPKebbtm7zlz7RUhsaxsfHuH U4dnPWk2q7q3ZBQvusWoew==; 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 1xTG7k-009MQ7-1I; Tue, 17 Nov 2026 11:13:27 +0100 From: Mirian Shilakadze To: khorenko@virtuozzo.com, ptikhomirov@virtuozzo.com Date: Tue, 17 Nov 2026 14:13:26 +0400 Message-ID: <20261117101329.225854-7-mirian.shilakadze@virtuozzo.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261117101329.225854-1-mirian.shilakadze@virtuozzo.com> References: <20261117101329.225854-1-mirian.shilakadze@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 v2 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 afa846593a11..bad7690ce32e 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