From nobody Fri Dec 06 21:42:39 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y4l9D0qHbz5fwRB; Fri, 06 Dec 2024 21:42:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y4l9D0J4Pz44rn; Fri, 6 Dec 2024 21:42:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733521360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qIL+x9+rBVmwU+oxyI3nFkuNpjbBV+Jj+lFdxpbmBdQ=; b=BxvFKlOd9hI2GVHaLWyVBho4E4S3ZYYrScTdqTAovG+pS6fW3dnEH/a6sUlmRWk2WAwsMr YWwJvZ/MT0Cx8yLQhjzUD+f3RUSRg9goqfY0re20rAoQ4PIA2fOcm3bQ5IM1DNVLRzght0 csV2q9LnUonjlX9qVJoUJJLcSzOUq/UQkrpD9qAAUW5riFeG30nABpyZWVmJwAxnfY0xeU AlsGrbMhvalQKSEfw/GShovl3ISaZs1SIAVrduptOr7DM1k2ypLi118p5hsAaXvpIy+Ko+ dusMx+NJWe9Q0fTj5o4sGI5FBwtK9pdxlOP1ZYpqrKVj4aoaCSo+KA5on2ImTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733521360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qIL+x9+rBVmwU+oxyI3nFkuNpjbBV+Jj+lFdxpbmBdQ=; b=aqWrMQh3bynBrGyoe1QCzWPq1U8O6XPxqrgp++x8OaMHYyrhOR3+XBdOcnoMHxgg92eW6C lvSWansyr/sqHBjWyBOQMOpTHGzgx5/rXYyWrb4f8iacjXxIW2BG+PfNrrM/uXtzElAXwH zLyhJ5DIa5V3MVsjUGLzzcowTHBjl3g5ywVFCncwmg/Y+oBmDlZB0yNLLWdShs1RA5/3jQ XJMbRzL3P6jPMvRAsGBONpGFG90Y5kjdEN1dfQHu0De5hpV6U46gTA38hxW8TZsx5p2IFO JSBHmwpvMuYDb0aq2tWuP47vUTv4sxss6C2/k7AftfYIoeWwYF2z+5Tvj62EeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733521360; a=rsa-sha256; cv=none; b=p3bvBTFjyIJWzJ/3hGSBynExfkDJmmBru1THkNFoww2kZD+h2tRr/Vfay5H9KYmckC5f4n V5ensqYA/NAiAj+DjhLZjxshwW9LDeHeGcTrIXi/i0iI1SdV97h4A038MT+RJPaVdNW5rX QoKxhzT3t1WfdG+mTkhg6DlKTlr1Zw0aHUUlP3ivyBZtSXk9p5vD2nTSXiS3bEg8NZz5Mc E7ag1TN0pNLljx5GMt+iTVdmjWT6xZJFBN3hZEbAWyiuqFV6jNqAQIXgTu7fOjmEl5rPs3 L4ALJAnnNM5quVsM/ifEaI7fERBeAK3PUABFLwXgzKNu4QF+jWMjZ4I/Pud6ow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y4l9C70tTzvqL; Fri, 6 Dec 2024 21:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B6Lgd84095069; Fri, 6 Dec 2024 21:42:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B6LgdPM095066; Fri, 6 Dec 2024 21:42:39 GMT (envelope-from git) Date: Fri, 6 Dec 2024 21:42:39 GMT Message-Id: <202412062142.4B6LgdPM095066@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 831531a82e0f - main - prison_proc_iterate(): make it work for prison0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 831531a82e0f1d1d7b97e50c0587639322ed8d2e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=831531a82e0f1d1d7b97e50c0587639322ed8d2e commit 831531a82e0f1d1d7b97e50c0587639322ed8d2e Author: Konstantin Belousov AuthorDate: 2024-12-06 17:01:00 +0000 Commit: Konstantin Belousov CommitDate: 2024-12-06 21:42:26 +0000 prison_proc_iterate(): make it work for prison0 Do not exclude processes owned by host/prison0 if there are jails configured. PR: 283163 Reviewed by: jamie, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47943 --- sys/kern/kern_jail.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 38aea998d196..80503570b776 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -3085,8 +3085,7 @@ prison_proc_iterate(struct prison *pr, void (*cb)(struct proc *, void *), FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); if (p->p_state != PRS_NEW && p->p_ucred != NULL) { - for (ppr = p->p_ucred->cr_prison; - ppr != &prison0; + for (ppr = p->p_ucred->cr_prison; ppr != NULL; ppr = ppr->pr_parent) { if (ppr == pr) { cb(p, cbarg);