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 01F51803BB for ; Wed, 18 Nov 2026 10:38:25 +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 6AIAbAx6023412; Wed, 18 Nov 2026 13:37:12 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AIAbAx6023412 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="dlOnkw6y" Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AIAb1KN023380 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 18 Nov 2026 13:37:01 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AIAb1KN023380 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-492d47f142cso443251f8f.0 for ; Wed, 18 Nov 2026 02:37:01 -0800 (PST) X-Gm-Message-State: APuU4Z8unCiNFdPt5I70bE7cGP+K8CtYR7GzEAM3X++agNYej9aCPRg+ +T182efJlf5VtB/WaM9Kd3epBqbZkyvCgShK0H5usc1MdiGwSIQrOcr0B59CL747pRLh78RRtbn JP6Q3gzn/Hh+rcDli8up1nMYnpOYiWJzDXCYwbE1Ep11r7/xHC2YF7g== X-Gm-Gg: AZFdTZdMaXQ61VpJViAdmCTEfwbi50+7fSRuWLzZMVdXyFHXFayUcbBljy+tTtVaJS/ iTni/t1yqFqrGuNfUiRqMwR2cRxZMt86X9FxEbXhGLGePe1OxVsHpBecbbhSoVs8UyvXCzu1/tc Xi2w1QKXnielEflO4DakKnCn00ZMlp5tt95g2IC0ovwtt56W1VCjvR90EebZNovUdIaoOwykSjC sfcmK86SvEoNJhKTj+THGd4tUPTlJntaBskFBZIr5YOBm5SC0/PAUx8OWN4g/qTfv8am0zEZ20+ 1DWMSvvVmAxDZ4n/uK0L+N9qj7+/7UE1+Go512bY+jVebj1vl+veo2sK5gzyAWlJ6PM07YphO7g UPEMDzfqvYS8NAs60UdUNPf6/K2kM X-Received: by 2002:a05:6000:4b0e:b0:491:c392:1f31 with SMTP id ffacd0b85a97d-4a377f4eef4mr11296654f8f.28.1794998220789; Wed, 18 Nov 2026 02:37:00 -0800 (PST) X-Received: by 2002:a05:6000:4b0e:b0:491:c392:1f31 with SMTP id ffacd0b85a97d-4a377f4eef4mr11296593f8f.28.1794998220052; Wed, 18 Nov 2026 02:37:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794998220; cv=none; d=google.com; s=arc-20260327; b=pnvitxkWpLo5vlrhQqrOsu60nzZ9ZR+D1Gw72LfJZKwwQPgWxnjDvERt7qcO3oDQyS ZoBzKsL4Q6+OurcByPQmC5OK0BIMbQ2btwJnJQdwaTbEtGkMjM+Eo922oUVqKEeUw1vm 77Q2W1VtI2d4RB2qDt9mPnnXuXCMRgyi69GdtDKwrBsbSsSY01naAF8OmzVp/fPMPDUH 8paLCCB70qJ/17uFkAwWoA5uZNmBM0JKM349SFreB3e60mX8vdGmL/OMZE/Pa1yFQBe/ 4XsGsyTLikMkTjDCelnFO+Wo2snATsIvskYHeSy93/O4DWDwjqyABiK3Z0VFqRkyh7bC OIdQ== 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=aL7ed+ZZr9P/3D6v2F8uB2LJmBCll9HV1XMGEy3jLEuaE978L0f62/7nEHT7IsNfWu dYm6VdYkPqa9YLDxcQrk/uWvB3/Ek458uqh7iA8lCNlst8GBLLBCjVw6bxxJqsvuaSFw kVgNEsULRhFCP+m2BbX0itDsZx8I98GvJ6A85ClkWkUcOZWi8+T7ksYIka1Gub45hEAA 2IBluy+cG3ybo5IzQlD1+sD21KQLoZif16qWyib8aTcsbwhtUSVuG7dUy/JzDzkx7blL m0IPkucgO5nU1EOMCowMpfUbbJCeSFicwt2Oh1b5ShHQCdlZAid5uRW6QEV6MAfjtm+p 0WZA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=dlOnkw6y; 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-4a650f17cd2si4372178f8f.8.2026.11.18.02.36.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2026 02:37:00 -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=dlOnkw6y; 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=dlOnkw6ykuXj dyaVkmuZ0OJKad3IzxEAAH9qj+6pkfzwgNKMvENM8/qOK54GjGnJYPU4g2bEjfjJyCGvzavR1SI2u Hyo1dSwMl4javPeKDdVtEWaTA44blIqroK7436GyyjhBoDliZxQtouyVc/U481x26xkdRMlewijCn RfRe20Y5oBCTz46Qvw7nePO2EWlZ/eRXA8rfJVNSFTRDsUc//mnXEDIdMkxFeRKkBU2dalFBUIKkY GgmN8Zk8LDwXdW92oHkQh9NesKQAVDBSMeLw26adAJvr68omM1nLvK3/smRD+erz0HJMwlbcfDTDc LGogmr7Xb0B2ZecmSBfSlA==; 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 1xTcxt-001uKo-2e; Wed, 18 Nov 2026 11:36:59 +0100 From: Mirian Shilakadze To: khorenko@virtuozzo.com, ptikhomirov@virtuozzo.com Date: Wed, 18 Nov 2026 14:36:34 +0400 Message-ID: <20261118103656.363171-3-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 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