From nobody Thu Sep 28 15:10:58 2023 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 4RxH4251wRz4tv81; Thu, 28 Sep 2023 15:10:58 +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 4RxH422Pc2z3Z6k; Thu, 28 Sep 2023 15:10:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695913858; 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=cyaRaWRV44bWRtzVaswd7rPLc0ZybKiT42gfsIcWQcY=; b=dpbbEoHplttvJrryRfcF5cuze+XBvJbFbaNkmQg5FoCKP5Jijh3SPCsaaN9YFdTH1RObpy sCkAkMJVRnBAH+oyuuUVNL8Lbfa4V+dv+KOIIAabl5a23Pfc1Jjvj7DPGOminDI1wOYp4M afHpVikVVft8zxhZzvf+sfEP1negtctag1BB1uH7QhvlGQpwAwREYNZxpO0f8bjMKOCUjw BQ17mC3htn+On5ScE8PincvhHy1bgxwOWBcH9munBu7qvoTC+UMkAFaYm9Ihti8ewjmdLk DI2+dBnekZNiBBXFpzvTEDCUSz8AcfYt4UCygJH+rOR3kAE+q2bQy2kOkY3bCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695913858; a=rsa-sha256; cv=none; b=qE5NLY2HA2jgnexVKAbmlGS+bsUGMpZYM+5F/OhYHEg00fp//Nz2XGzgq/f/6+0rpi1DqV 8RJhjHuuqtrtrr4G5T5pF8OBj+wXG0BJy+PY+W7+vkaZOe2s3puMtFN3uvOdTFaDiyWRxa s9T0kvcMIakpRrFst3p0JkJfQ7lWPuXARlvfI9f1c0Bqfs9S8NLHRud1XmfkmpOXOZuXnn i6s6VVFg9yifrArkNRdRsR/7CHTnN58qPfT/dOK5I9JNnCHtQbFEzCEMjF9ekznhqAlpo8 wHHtb1yNK1fP5wpZ+caNL44B6YXtCpcujNCvuJ4FIkuOCNrAOp78f4nMyvycLg== 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=1695913858; 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=cyaRaWRV44bWRtzVaswd7rPLc0ZybKiT42gfsIcWQcY=; b=efFD9AW8pmM84knZxgTbu6lGw9OcOn4FHHHAkmZVkjNWPv4gtslF3dhm5RaVbxoXfHSV+o oZGQ59n/6uwy2rlROoPqpjgE2xAE3OdZWTzD5b+Vatpc6BvB+pOHwTXEz+gPdT+SM6oGDu FJm/d1KnL4WYJ6ehMAx7qRjJb1WRzBytnFEK+m1ssVVleVcmBGdZG8eg8yokFuayz4hgt2 YDgHPacNh+pOESv0HhArFqIYqIAK5vsnuKZSZFPZGMTBM6v7mirb670QIKyoMz5S78vdfZ HKIzuD2/UFc3VizfFDD7y1liPODKIkGfZc1CUSMhlo515S9aXxA0C7VKbA3FOw== 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 4RxH421ClZzBXj; Thu, 28 Sep 2023 15:10:58 +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 38SFAw9U048140; Thu, 28 Sep 2023 15:10:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38SFAwYd048137; Thu, 28 Sep 2023 15:10:58 GMT (envelope-from git) Date: Thu, 28 Sep 2023 15:10:58 GMT Message-Id: <202309281510.38SFAwYd048137@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: d952820105d6 - main - ptrace(2): Disabling: Describe influence of security.bsd.see_jail_proc 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: d952820105d6a2ad87ddf3bdc6c5fc5215d13b87 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d952820105d6a2ad87ddf3bdc6c5fc5215d13b87 commit d952820105d6a2ad87ddf3bdc6c5fc5215d13b87 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:48 +0000 Commit: Mitchell Horne CommitDate: 2023-09-28 15:05:47 +0000 ptrace(2): Disabling: Describe influence of security.bsd.see_jail_proc Reviewed by: mhorne, emaste, pauamma_gundo.com MFC after: 2 weeks Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D41109 --- 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