From nobody Wed Oct 18 18:04:00 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 4S9dyT0q2Gz4xLC7; Wed, 18 Oct 2023 18:04:01 +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 4S9dyT0JZYz4Y0G; Wed, 18 Oct 2023 18:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697652241; 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=N2rQCzdHqXwcKr90nmBV8ELgB711fRZD7ck4laxJLyw=; b=YiKhyulHJAHotLXU9ChMzqlg69xulYjbcdVk4Ap6xTfI8kkDZV4BvZC1R9RwxFmISYtq9o UmWceTiaTxMm61k1n5eVW4uvO/XmShoTd8KxxljMDbuUTSmveKXuXeqir1SjfpWLiOBDIn 0WxDg+C2Hl/uUUGadxULsHD9HOv1zTmD7gsocRyiNRqoK/qBKb8RpuPH4wmsn3oQds7sAK 73gj/HSjDrWb7jXcJIIjdbqGocD+ZD/hOq+e/LsvJPwBnRp5k4OeMAOKm96HG8YkoeAvCh WFMak2S9zw5L7+5q24fo5fzv0oGDVRl/5So/z6kilk5jztdOwEEwhTmGFg9q+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697652241; a=rsa-sha256; cv=none; b=m+4XMGkf3CNqndjWEWvXbIv9BmIvZ/yq8sHqVwkLCeIhCaWfJPq5mQEMqwy6VDQD+0Mzta RgvABjfWH+H+XYhuoppPxp5XKCD+VpM4IQBXYQpRUl/mj5aeNavNFoFu5xVmurvGk5pz74 kcLkUIIiqnlkPb8ErJLTxxeE4FI6cRS3ibUE4atccsE/y/FLYEzemKPXKB4UNMqJ8+HawW gaUoybLnNqcnJ7XfJJNEc4YvCxAVmTc3unaNaHKKKUDlFSv7PEL2PtzBsBihEUyUkMTZv2 VVFr1hdZXA13zWOy+itgWh/vJFQoEikOCnIpR+RknxPwpiW7oEaW7sNN0oGK1A== 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=1697652241; 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=N2rQCzdHqXwcKr90nmBV8ELgB711fRZD7ck4laxJLyw=; b=Z3Prd3hW9B5WxbbIEPd39VAw+UmocflQyIuYA/e3lGTvOtz9+Dex3bmkSo8B66en0BNvtp r++8XY6ThE+8exTSUypz4xUfJpXxpgZ+SLj76U7wGAXoTp9cAsuJPyRXDJ8hKKbsgnkPae Zsy6w9UFnVGLmuYTnmq++Tv/oyUV+ypbgQk0B6f2TNYNqADPQL9VOFkdtuMH5t9ZR7TAXV BFB75AQcs9tHOhl9Hzvyp5EkYB+Cme9xX3szM2z56+8n5t9gpPYW4pCWVkrvZy5Z4hwrt2 DrQk9+IqRUxoYxvlCnt5/WbI4Hh7+nGcO8Y4mSoUDt2NcCa4tp7rGf36ycL8/g== 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 4S9dyS63Xxz1tT; Wed, 18 Oct 2023 18:04:00 +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 39II40GO045166; Wed, 18 Oct 2023 18:04:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39II40nQ045163; Wed, 18 Oct 2023 18:04:00 GMT (envelope-from git) Date: Wed, 18 Oct 2023 18:04:00 GMT Message-Id: <202310181804.39II40nQ045163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 664a0fc4aa9e - releng/14.0 - 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 664a0fc4aa9e8ee861fbb6de167bdf480b308bde Auto-Submitted: auto-generated The branch releng/14.0 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=664a0fc4aa9e8ee861fbb6de167bdf480b308bde commit 664a0fc4aa9e8ee861fbb6de167bdf480b308bde Author: Olivier Certner AuthorDate: 2023-08-17 23:54:48 +0000 Commit: Mitchell Horne CommitDate: 2023-10-18 18:02:12 +0000 ptrace(2): Disabling: Describe influence of security.bsd.see_jail_proc Approved by: re (gjb) Reviewed by: mhorne, emaste, pauamma_gundo.com Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D41109 (cherry picked from commit d952820105d6a2ad87ddf3bdc6c5fc5215d13b87) (cherry picked from commit 7c069dbe8e561436b4b2a0d6cf2c2483bd4e0fa3) --- 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 d7d244b1d84a..ae1770315aa5 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