From nobody Thu Dec 21 13:43:44 2023 X-Original-To: dev-commits-src-all@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 4Sws8d12sqz54pXh; Thu, 21 Dec 2023 13:43:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8c5nNnz4P2K; Thu, 21 Dec 2023 13:43:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166224; 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=CCQofkutay05AvN3ruFtKL55S213Lx3yX+8qaXz/YqE=; b=pYw/eEKSxWJNfYnvA2Xb8Q50LU/xc3eFhp3Gu1ZzeLvHd6l3nfgfzrBtCM8I1gd1orDieg UIQPYqmZyJPP9QdTw/0o5FkOlqc4yxMWbkC9HOvUte3YhmfJC9t2A1uzWklyw3y25qBfdN EZjcJ7mSeOdADyY3W1Otu4H14+bn+j2PqcvQnufsO1NuIQ3EtgMXvni2ae/6cHQQAro3DW J732ExCC0GNg6ZKv+YiVf2ESkbBQbAWR07EKKH+MLNHtgeKfi18/r5jeyxTKWbaTw36Jc1 mfwKXDVjGUtkJdsi+1s40YzVxJMoKY1tAPV8e8zg5J+xisASosE+Xhrm2L0LqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166224; a=rsa-sha256; cv=none; b=JGgdRfx2BQ+KLYE8nUIaFNjfngNkYqbvc+qjLEpvR3M7ngujrhFRHx5IzNlDENCMW+twxV Gm4/4vpEMduBeMpr9qmWs5hWUpGiWDRvkqO2YS/uYXdA+cU6ERvkO4WOW7ItgiFF/5DbU0 i4Mc8R+pvaSow7qyV6qBOXnwzU/lM5xcoADq3WCHQ0M4RyP+t8j/MB7EMzKkI0pJQOMrxY UowNgv7nWTPQZvWtm1hsw5U5AEXSAZ+O4q+5dEyD9f5wMx8SZdVdWnwRE6gNP9tF/pmzr0 OKGLnnStU2H4NxC02sFKf/nwaTa0NVz8tY2J52FFa6iWT3YZGP3bCamTF5tfFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166224; 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=CCQofkutay05AvN3ruFtKL55S213Lx3yX+8qaXz/YqE=; b=xnywuNnPrxGCwb7KxpSarU7+OrD8ZkIFhltpfqYpEBOAwamK+BaszPGcCwoWxGu4sw2A54 dR4SJeOmzlTU0IkcNDIsss6Pp9WIXZr9M9clYNNQe7g4Mn2cf1g5gU8TVJ4737dTV/knGW OGji4hMD0oESgk8Bs0vfYub6TO89Ug5E2BQ5a7gaHn2aZG5b+FElIpkRPE5yZF0J2C0yk/ ogTCjDmL7ureuwC09yf79IXqZJiO36AnrS0q3Vn8ass3KekKvx9Ni+Xwy3Xapn0+Ioc835 AdKSJ1e2gYkFUGn4PhofhdQxwIkSnK5tbKIcPHYVq2dI1HJ0QEz1b0zcV6dikg== 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 4Sws8c4tz0zZRT; Thu, 21 Dec 2023 13:43:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhiOo079458; Thu, 21 Dec 2023 13:43:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhiJd079455; Thu, 21 Dec 2023 13:43:44 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:44 GMT Message-Id: <202312211343.3BLDhiJd079455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 0c01901f122d - stable/13 - ptrace(2): Disabling: Describe influence of security.bsd.see_jail_proc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0c01901f122d1d9590f00c9b6fbd9f4d79e7d4f0 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0c01901f122d1d9590f00c9b6fbd9f4d79e7d4f0 commit 0c01901f122d1d9590f00c9b6fbd9f4d79e7d4f0 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:48 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:38:31 +0000 ptrace(2): Disabling: Describe influence of security.bsd.see_jail_proc Reviewed by: mhorne, emaste, pauamma_gundo.com Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D41109 (cherry picked from commit d952820105d6a2ad87ddf3bdc6c5fc5215d13b87) Approved by: markj (mentor) --- lib/libc/sys/ptrace.2 | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index f417b4f021af..25c7663114a5 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -1,7 +1,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd December 15, 2022 +.Dd August 18, 2023 .Dt PTRACE 2 .Os .Sh NAME @@ -149,31 +149,37 @@ its scope. The following controls are provided for this: .Bl -tag -width security.bsd.unprivileged_proc_debug .It Dv security.bsd.allow_ptrace -Setting this sysctl to zero value makes +Setting this sysctl to zero makes .Nm return .Er ENOSYS always as if the syscall is not implemented by the kernel. .It Dv security.bsd.unprivileged_proc_debug -Setting this sysctl to zero disallows use of +Setting this sysctl to zero disallows the use of .Fn ptrace by unprivileged processes. .It Dv security.bsd.see_other_uids -Setting this sysctl to zero value disallows +Setting this sysctl to zero prevents .Fn ptrace -requests from targeting processes with the real user identifier different -from the real user identifier of the caller. -The requests return -.Er ESRCH -if policy is not met. +requests from targeting processes with a real user identifier different +from the caller's. +These requests will fail with error +.Er ESRCH . .It Dv security.bsd.see_other_gids -Setting this sysctl to zero value disallows +Setting this sysctl to zero disallows .Fn ptrace -requests from process belonging to a group that is not also one of -the group of the target process. -The requests return -.Er ESRCH -if policy is not met. +requests from processes that have no groups in common with the target process, +considering their sets of real and supplementary groups. +These requests will fail with error +.Er ESRCH . +.It Dv security.bsd.see_jail_proc +Setting this sysctl to zero disallows +.Fn ptrace +requests from processes belonging to a different jail than that of the target +process, even if the requesting process' jail is an ancestor of the target +process'. +These requests will fail with error +.Er ESRCH . .It Dv securelevel and init The .Xr init 1