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 C7177803BB for ; Tue, 17 Nov 2026 10:15:13 +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 6AHADr78007928; Tue, 17 Nov 2026 13:13:55 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AHADr78007928 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="sccwp96S" 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 6AHADZ9Z007882 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 17 Nov 2026 13:13:36 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AHADZ9Z007882 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4b0a307487aso21033985e9.1 for ; Tue, 17 Nov 2026 02:13:36 -0800 (PST) X-Gm-Message-State: APuU4Z9YiyPL8kfQtW4dWCwlABRxRR+sXgwhO36QrfKKFD5WVoZGCKPO BreY2CLsnNVnn8EhSZrVozvKMni3YRix0Xr6/vOrkqUW6PxClPOW+ySgEyhu8DNmK3yspsTNbp1 dB99v1yEaHE9TIL3tnfa7qOdj2N1n2bKUigaaONsidnQJXKNT7UVuDQ== X-Gm-Gg: AYBFou0dOBC46U87ybbgCveNz67luoRJKZ6nRzQ1Gs7ZohAOTIMr3o0adinN1I23Tok 97iHIH+638muzjpNdriL+bIBRtrAfYuRBY2Vtscw/5NzNCLprYwVE0iNKT+Ytzo2NINn5665Wfc WSin8xx6Mi5IIhWo+VyZAz+qDNS3WtlNJUzhmv8dunPJUvUly2lWJpDZdPVHh3pmTe1avaF0WXK iYpHc6FULvWX2R6Kg6SAUF9ZFz96x9+N981vjrZxfHEAEm7aAyPLamzr60b5rX16Q9jI4QH/qLd Sfmc+LCuzAEsD37sIzOzvclEOy/quuJl0Cbh+zbicdhj/sTHtWDH39Mon28+mN55DkUCSuBASXt NKAXKnIcNwB7nkS3/X0fqPXFDsHmo X-Received: by 2002:a05:600c:3e1a:b0:4a2:191f:7cbd with SMTP id 5b1f17b1804b1-4bb55a3e31emr247113425e9.11.1794910415346; Tue, 17 Nov 2026 02:13:35 -0800 (PST) X-Received: by 2002:a05:600c:3e1a:b0:4a2:191f:7cbd with SMTP id 5b1f17b1804b1-4bb55a3e31emr247113095e9.11.1794910414787; Tue, 17 Nov 2026 02:13:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794910414; cv=none; d=google.com; s=arc-20260327; b=D7tHxo1jUAxUK3oIb0N2eZTU3A74M19Vj78K5rRcBE7DQJ74+adcBVNiOd/dwOpyQQ ALOva8KwQLFnwC4iUVFnjLDBfWzEC9gxMLE9BSUsLZmNF9Yi4LNOFky6atxFIghbIQQU aS9P/EOWsc2ZMSxAsSzEEvHP2R9W780jEFcmYYI2VN1eF4WH7+95SpsuwhaMaYqF1la4 V+lFEfxatZOMEBfL0hX9UG2X2bU5b2lt24Sir3Tg3s/0ldiQQnTwy/xt8JccNxCIVvVR +cnlJKmnJyShijHTL61Ovhh1v4ZMWPAtm9bGjP8/qHAzSKUOwDfWbWJzQ8/afdOV08bb QewA== 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=jQYVRSOT/KUMXQNHE22BSq4x03Y84+5qxNOjDytvKR0=; fh=wpoNUURlquLpJK/14Kny0oMIYkY7mYwjJ/Ils9UT2kk=; b=mQZPgjEMHkOCL80vyeEF/imKvzmjtFxuNF1k/9Sv+e1mP3dGkkDQjdV203HK5Fjv5c fciiAViRtCCdmnwwPwc2k2YZ7ZzupUKJ65zg5BKtspIX5QnifDWWsL5y1Yt+YkiBQtOa 6auN6CK8Dje/7/2Ak4QqrxOdtIeG4o/Mil3KpsVXle85ViCymlla8uROXtihuy2pBzMY D9awTBA9OgbZYkHPHzKCI50l2t+GKQ2cs64hveBUAd+z/6nXv8T5S4zF9p9gAaUyvKlG CdigBtBrkXK6w2coF9Mk9X5B1Qb/Ymv+Bqc/Krf++XLBNl+QiZMd/DcejfSKMBBREv+Q BALA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=sccwp96S; 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-49c652b72e3si27621526f8f.499.2026.11.17.02.13.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2026 02:13:34 -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=sccwp96S; 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=jQYVRSOT/KUMXQNHE22BSq4x03Y84+5qxNOjDytvKR0=; b=sccwp96SfoIz e4gP3sfkrsKNMGc1sEd9Xrx4MpcCF6oTim+96gM03yKKIg7P+I2fBXfDpcDkxDFeG0JR1AmuG2mPi LsSTiz6VU7V3FUzwQ49wF/zDnbbg/lLh7JJ8K1xaT7bQotoO1li97/z7bKeff2tRYH6G39Wd4/Ywj M8agP0F7jNawZhYkPBINGujaH8mEepspOvxl0xzwD7ACD08EfumHJkoyduBBrzDuBFgKK7elSUnYR YsM47qeH/2MCXnn0akO1HKL44IUzvM00LNB7ntTjZpOdIP2fJo014ZtMd7l0x6oqRgBUPSapFe+SI nctRor/obOAQMRO2eX/RoA==; 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 1xTG7i-009MQ7-0G; Tue, 17 Nov 2026 11:13:24 +0100 From: Mirian Shilakadze To: khorenko@virtuozzo.com, ptikhomirov@virtuozzo.com Date: Tue, 17 Nov 2026 14:13:22 +0400 Message-ID: <20261117101329.225854-3-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 2/6] ve: hide only the tasks the host sends into 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 ve_setup_task() marks a task entering a running VE VD_VE_ENTER_TASK, which hides it from ptrace and /proc//exe inside the VE. A container task gets the mark too when it setns()es into its own VE or enters a nested one, and a host task entering a stopping or stopped VE is not hidden at all. The mark says a task is the host's, a later change lets it skip the mount limit of a pseudosuper VE, and it goes to the mm, which a container task may share with others. So mark only tasks coming from the host, in every VE state but starting, which the next change handles. A task entering its nested VE is no longer hidden there. In a pseudosuper VE the host's tasks cannot be told from the container's yet, so a task leaving one is still marked until the next change. Feature: trace: prohibit tracing sensitive tasks from CT https://virtuozzo.atlassian.net/browse/VSTOR-151265 Signed-off-by: Mirian Shilakadze --- kernel/ve/ve.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c index 72a2834707c5..ff1c7f9b88c7 100644 --- a/kernel/ve/ve.c +++ b/kernel/ve/ve.c @@ -1837,8 +1837,14 @@ void ve_setup_task(struct task_struct *task, struct ve_struct *old_ve, if (ve == &ve0) return; - /* this prohibits ptracing of task entered to VE from host system */ - if (VE_IS_RUNNING(ve) && task->mm) + /* + * A task the host sends into a started VE is hidden from the tasks of + * the VE. The mark goes to the mm, which may be shared, so a task + * coming from a container never gets it, unless the container is + * pseudosuper: the host's tasks there cannot be told from its own. + */ + if (task->mm && old_ve != ve && ve->state != VE_STATE_STARTING && + (ve_is_super(old_ve) || old_ve->is_pseudosuper)) task->mm->vps_dumpable = VD_VE_ENTER_TASK; /* Drop OOM protection. */ -- 2.43.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel