From nobody Fri Aug 08 04:36:34 2025 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 4byrpD3200z648rc; Fri, 08 Aug 2025 04:36:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4byrpD2Ct8z3RJZ; Fri, 08 Aug 2025 04:36:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754627796; 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: in-reply-to:in-reply-to:references:references; bh=tEdHlPCjf2GflT4Tq3AqawWYvLIbzkuj4b9Lfz6rJZo=; b=Rxjo98wrbqWO/uQMxqlcMlMT89H1VbIHxW4BaiPIae1i/KWi54r6D/wokhbDsUcEY/Ml/p aAkkmoQEVKpl/LsVhnJDqjG7ccxjBGky+tqXjvPVG+rBc1eEexaz4e5K7vsRbjL8tbWssZ QhcXvtaiOeGHRF2ZhC7uP+nrCeRQb8/+aWvRjs0DBAMbThuYVhE48vq/+aBd3ftmb3VoxA N79tCPNi4MO4zvbLaSHlAia7BBjljH0xZoUjRWK5tSZ/rzSenVsN+m3D/xzLW5roDllxpB aWXRjGcI3SAgpr/Qgz5J7JNtDIBh1l2aQNTnTdIOBNVAjziiwWvrXXTrzQiDqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754627796; 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: in-reply-to:in-reply-to:references:references; bh=tEdHlPCjf2GflT4Tq3AqawWYvLIbzkuj4b9Lfz6rJZo=; b=L45x9oYEhKquWAHR82FIsVFkHuhnIKvk100WBBYJJlqlrUgvbZmpHBFREjlLs2dQO5WPFE R1TUhd4W6THvD11bgyu0phdn//KS7pybN5YF5mwLDlSMZmHxQ10YWy9JhZE5r7ZKe36iDO cFScZB3LRXYY/itl2+YaIsUpCMXzaQDZ4xA7MC6HfS/x4UPED9+b92Z0C0hKvNAnx0UNBM yryeAtRsnMS1bTOabE3tI2HKwb7Y5p5n8hM2FlXKcZpyLaGG4ACmlJkOCZO4hK2SWapyEB WgveIIxsMURaS/hX1rSu/2kF7cs0jLrxo8SFcYsgqXPb0TKHkXupn1hRlOAhPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754627796; a=rsa-sha256; cv=none; b=pPlOUIdf+y4AukNMvytZfE5ylTsagcAF8Djte+EgTp6/RaBgldBDUqudJ3cK1T6OJCvOsF A6nqT3KJdWnpfT9d2p0BVWWj0ijlpfy0ge+VPwrRr1aQCAggoLtw7nBl5Tj4KQJFYuPXd8 z0oNlFGJQ988qTaGJi1wFwKOhmCLhC3PFaJL3Dx3OcqF/vUs5X8JIQu5Nkl+tCtTPLeBmv YEB3x9gkFqOYkxCmLgNow6/0u9SLeVIN+z1ahi70wtQB8dqo9GsdmXJBIckRyYe2oB3MZu 09tsX9F+UTXZaU6USmrA6kv3s+GJg7Bk0zb/8zJzCCCMB/fUqE5AyJW7IdM38A== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4byrpC6V3wz50l; Fri, 08 Aug 2025 04:36:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <9fa64be6-988d-4d04-ada2-91a5b627ad56@FreeBSD.org> Date: Thu, 7 Aug 2025 23:36:34 -0500 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 User-Agent: Mozilla Thunderbird Subject: Re: git: 8a5ceebece03 - main - kern: disallow user scheduling/debugging/signalling of jailed procs From: Kyle Evans To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202508080427.5784RI42005179@gitrepo.freebsd.org> Content-Language: en-US In-Reply-To: <202508080427.5784RI42005179@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/7/25 23:27, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=8a5ceebece0311bc41180b3ca0ce7237def1e253 > > commit 8a5ceebece0311bc41180b3ca0ce7237def1e253 > Author: Kyle Evans > AuthorDate: 2025-08-08 04:26:51 +0000 > Commit: Kyle Evans > CommitDate: 2025-08-08 04:26:51 +0000 > > kern: disallow user scheduling/debugging/signalling of jailed procs > > Currently, jails are generally ignored when determining whether the > current process/thread can take action upon another, except to determine > if the target's jail is somewhere in the source's hierarchy. Notably, > uid 1001 in a jail (including prison0) can take action upon a process > run by uid 1001 inside of a subordinate jail by default. > > While this could be considered a feature at times, it is a scenario > that really should be deliberately crafted; there is no guarantee that > uid 1001 in the parent jail is at all related to uid 1001 in a > subordinate. > > This changes introduces three new privileges that grant a process > this kind of insight into other jails: > > - PRIV_DEBUG_DIFFJAIL > - PRIV_SCHED_DIFFJAIl > - PRIV_SIGNAL_DIFFJAIL > > These can be granted independently or in conjunction with the > accompanying *_DIFFCRED privileges, i.e.: > > - PRIV_DEBUG_DIFFCRED alone will let uid 1001 debug uid 1002, but > PRIV_DEBUG_DIFFJAIL is additionally needed to let it debug uid 1002 > in a jail. > > - PRIV_DEBUG_DIFFJAIL alone will let uid 1001 debug uid 1001 in a jail, > but will not allow it to debug uid 1002 in a jail. > > Note that security.bsd.see_jail_proc can be used for similar effects, > but does not prevent a user from learning the pid of a jailed process > with matching creds and signalling it or rescheduling it (e.g., cpuset). > Debugging is restricted by visibility in all cases, so that one is less > of a concern. > Sorry, I didn't rewrite this part of the message enough. As of olce@'s more recent changes in the area, visibility does in-fact restrict these actions, but it's useful to provide this additional level of control so that one doesn't have to apply that level of hammer to restrict interactions. > > This change adds a new jail(8) parameter for the parent to indicate on > a per-jail basis if its users are open to being tampered with by the > parent's unprivileged users: allow.unprivileged_parent_tampering. This > is disabled by default, but may be enabled to bypass the new priv(9) > checks in some scenarios where the functionality is useful. For > development setups that involve regularly debugging jailed processes > from outside the jail, consider adding a default > `allow.unprivileged_parent_tampering;` to your /etc/jail.conf. > > This may get MFC'd in the future with the default flipped to preserve > pre-existing behavior but allow opt-in for the new position sooner. > > Reviewed by: jamie > Differential Revision: https://reviews.freebsd.org/D51645