2 .\" Copyright (c) 2003 Joseph Koshy <jkoshy@freebsd.org>
4 .\" All rights reserved.
6 .\" This program is free software.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
17 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
18 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 .Nd determine debuggability of a process
39 .Fn p_candebug "struct thread *td" "struct proc *p"
41 This function can be used to determine if a given process
43 is debuggable by the thread
48 variables directly influence the behaviour of
50 .Bl -tag -width indent
51 .It Va kern.securelevel
52 Debugging of the init process is not allowed if this variable is
55 .It Va security.bsd.unprivileged_proc_debug
56 Must be set to a non-zero value to allow unprivileged processes
57 access to the kernel's debug facilities.
65 if the process denoted by
67 is debuggable by thread
69 or a non-zero error return value otherwise.
73 The MAC subsystem denied debuggability.
77 is in the process of being
82 lacks super-user credentials and process
84 is executing a set-user-ID or set-group-ID executable.
88 lacks super-user credentials and process
90 group set is not a subset of
96 lacks super-user credentials and process
98 user IDs do not match thread
104 denotes the initial process
110 is greater than zero.
114 is not visible to thread
117 .Xr cr_seeotheruids 9
119 .Xr cr_seeothergids 9 .
123 has been jailed and process
125 does not belong to the same jail as
128 The MAC subsystem denied debuggability.
134 .Xr cr_seeothergids 9 ,
135 .Xr cr_seeotheruids 9 ,