xref: /freebsd/usr.bin/proccontrol/proccontrol.1 (revision 2ef9ff7dd34a78a7890ba4d6de64da34d9c10942)
1.\" Copyright (c) 2019 The FreeBSD Foundation, Inc.
2.\" All rights reserved.
3.\"
4.\" This documentation was written by
5.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
6.\" from the FreeBSD Foundation.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
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.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.\" $FreeBSD$
30.\"
31.Dd March 13, 2019
32.Dt PROCCONTROL 1
33.Os
34.Sh NAME
35.Nm proccontrol
36.Nd Control some process execution aspects
37.Sh SYNOPSIS
38.Nm
39.Fl m Ar mode
40.Op Fl s Ar control
41.Op Fl q
42.Fl p Ar pid | command
43.Sh DESCRIPTION
44The
45.Nm
46command modifies the execution parameter of existing process
47specified by the
48.Ar pid
49argument, or starts execution of the new program
50.Ar command
51with the execution parameter set for it.
52.Pp
53Which execution parameter is changed, selected by the mandatory
54parameter
55.Ar mode .
56Possible values for
57.Ar mode
58are:
59.Bl -tag -width trapcap
60.It Ar aslr
61Control the Address Space Layout Randomization.
62Only applicable to the new process spawned.
63.It Ar trace
64Control the permission for debuggers to attach.
65Note that process is only allowed to enable tracing for itself,
66not for any other process.
67.It Ar trapcap
68Controls the signalling of capability mode access violations.
69.El
70.Pp
71The
72.Ar control
73specifies if the selected
74.Ar mode
75should be enabled or disabled.
76Possible values are
77.Ar enable
78and
79.Ar disable ,
80with the default value being
81.Ar enable
82if not specified.
83See
84.Xr procctl 2
85for detailed description of each mode effects and interaction with other
86process control facilities.
87.Pp
88The
89.Fl q
90switch makes the utility query and print the current setting for
91the selected mode.
92The
93.Fl q
94requires the query target process specification with
95.Fl p .
96.Sh EXIT STATUS
97.Ex -std
98.Sh EXAMPLES
99.Bl -bullet
100.It
101To disable debuggers attachment to the process 1020, execute
102.Dl "proccontrol -m trace -s disable -p 1020"
103.It
104To execute the
105.Xr uniq 1
106program in a mode where capability access violations cause
107.Dv SIGTRAP
108delivery, do
109.Dl "proccontrol -m trapcap uniq"
110.It
111To query the current ASLR enablement mode for the running
112process 1020, do
113.Dl "proccontrol -m aslr -q -p 1020"
114.El
115.Sh SEE ALSO
116.Xr kill 2 ,
117.Xr procctl 2 ,
118.Xr ptrace 2
119.Sh HISTORY
120The
121.Nm
122command appeared in
123.Fx 10.0 .
124.Sh AUTHORS
125The
126.Nm
127command and this manual page were written by
128.An Konstantin Belousov Aq Mt kib@freebsd.org
129under sponsorship from The FreeBSD Foundation.
130