xref: /freebsd/usr.bin/proccontrol/proccontrol.1 (revision 7899f917b1c0ea178f1d2be0cfb452086d079d23)
1.\" Copyright (c) 2019 The FreeBSD Foundation, Inc.
2.\"
3.\" This documentation was written by
4.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
5.\" from the FreeBSD Foundation.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.Dd August 23, 2024
29.Dt PROCCONTROL 1
30.Os
31.Sh NAME
32.Nm proccontrol
33.Nd Control some process execution aspects
34.Sh SYNOPSIS
35.Nm
36.Fl m Ar mode
37.Fl s Ar control
38.Fl p Ar pid | command
39.Nm
40.Fl m Ar mode
41.Fl q
42.Op 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.It Ar protmax
70Controls the implicit PROT_MAX application for
71.Xr mmap 2 .
72.It Ar nonewprivs
73Controls disabling the setuid and sgid bits for
74.Xr execve 2 .
75.It Ar wxmap
76Controls the write exclusive execute mode for mappings.
77.It Ar kpti
78Controls the KPTI enable, AMD64 only.
79.It Ar la48
80Control limiting usermode process address space to 48 bits of address,
81AMD64 only, on machines capable of 57-bit addressing.
82.El
83.Pp
84The
85.Ar control
86specifies if the selected
87.Ar mode
88should be enabled or disabled.
89Possible values are
90.Ar enable
91and
92.Ar disable ,
93with the default value being
94.Ar enable
95if not specified.
96See
97.Xr procctl 2
98for detailed description of each mode effects and interaction with other
99process control facilities.
100.Pp
101The
102.Fl q
103switch makes the utility query and print the current setting for
104the selected mode.
105The
106.Fl q
107requires the query target process specification with
108.Fl p .
109.Sh EXIT STATUS
110.Ex -std
111.Sh EXAMPLES
112.Bl -bullet
113.It
114To disable debuggers attachment to the process 1020, execute
115.Dl "proccontrol -m trace -s disable -p 1020"
116.It
117To execute the
118.Xr uniq 1
119program in a mode where capability access violations cause
120.Dv SIGTRAP
121delivery, do
122.Dl "proccontrol -m trapcap uniq"
123.It
124To query the current ASLR enablement mode for the running
125process 1020, do
126.Dl "proccontrol -m aslr -q -p 1020"
127.El
128.Sh SEE ALSO
129.Xr kill 2 ,
130.Xr procctl 2 ,
131.Xr ptrace 2 ,
132.Xr mitigations 7
133.Sh HISTORY
134The
135.Nm
136command appeared in
137.Fx 10.0 .
138.Sh AUTHORS
139The
140.Nm
141command and this manual page were written by
142.An Konstantin Belousov Aq Mt kib@freebsd.org
143under sponsorship from The FreeBSD Foundation.
144