xref: /freebsd/usr.bin/proccontrol/proccontrol.1 (revision b64c5a0ace59af62eff52bfe110a521dc73c937b)
1.\" Copyright (c) 2019 The FreeBSD Foundation
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 December 14, 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 logsigexit
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.It Ar logsigexit
83Controls the logging of exits due to a signal that would normally cause a core
84dump.
85.El
86.Pp
87The
88.Ar control
89specifies if the selected
90.Ar mode
91should be enabled or disabled.
92Possible values are
93.Ar enable
94and
95.Ar disable ,
96with the default value being
97.Ar enable
98if not specified.
99See
100.Xr procctl 2
101for detailed description of each mode effects and interaction with other
102process control facilities.
103.Pp
104The
105.Fl q
106switch makes the utility query and print the current setting for
107the selected mode.
108The
109.Fl q
110requires the query target process specification with
111.Fl p .
112.Sh EXIT STATUS
113.Ex -std
114.Sh EXAMPLES
115.Bl -bullet
116.It
117To disable debuggers attachment to the process 1020, execute
118.Dl "proccontrol -m trace -s disable -p 1020"
119.It
120To execute the
121.Xr uniq 1
122program in a mode where capability access violations cause
123.Dv SIGTRAP
124delivery, do
125.Dl "proccontrol -m trapcap uniq"
126.It
127To query the current ASLR enablement mode for the running
128process 1020, do
129.Dl "proccontrol -m aslr -q -p 1020"
130.El
131.Sh SEE ALSO
132.Xr kill 2 ,
133.Xr procctl 2 ,
134.Xr ptrace 2 ,
135.Xr mitigations 7
136.Sh HISTORY
137The
138.Nm
139command appeared in
140.Fx 10.0 .
141.Sh AUTHORS
142The
143.Nm
144command and this manual page were written by
145.An Konstantin Belousov Aq Mt kib@freebsd.org
146under sponsorship from The FreeBSD Foundation.
147