Debian Codegraph @

templates/man2/ptrace.2.pot

raw
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2026-06-05 06:38+0200\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <[email protected]>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "ptrace"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-10"
31 msgstr ""
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr ""
38
39 #. type: SH
40 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
41 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "NAME"
44 msgstr ""
45
46 #. type: Plain text
47 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
48 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
49 msgid "ptrace - process trace"
50 msgstr ""
51
52 #. type: SH
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 #, no-wrap
56 msgid "LIBRARY"
57 msgstr ""
58
59 #. type: Plain text
60 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
61 #: opensuse-leap-16-1 opensuse-tumbleweed
62 msgid "Standard C library (I<libc>,\\ I<-lc>)"
63 msgstr ""
64
65 #. type: SH
66 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
67 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
68 #, no-wrap
69 msgid "SYNOPSIS"
70 msgstr ""
71
72 #. type: Plain text
73 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
74 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
75 #, no-wrap
76 msgid "B<#include E<lt>sys/ptrace.hE<gt>>\n"
77 msgstr ""
78
79 #. type: Plain text
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid ""
84 "B<long ptrace(enum __ptrace_request >I<op>B<, pid_t >I<pid>B<,>\n"
85 "B< void *>I<addr>B<, void *>I<data>B<);>\n"
86 msgstr ""
87
88 #. type: SH
89 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
90 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
91 #, no-wrap
92 msgid "DESCRIPTION"
93 msgstr ""
94
95 #. type: Plain text
96 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
97 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
98 msgid ""
99 "The B<ptrace>() system call provides a means by which one process (the "
100 "\"tracer\") may observe and control the execution of another process (the "
101 "\"tracee\"), and examine and change the tracee's memory and registers. It "
102 "is primarily used to implement breakpoint debugging and system call tracing."
103 msgstr ""
104
105 #. type: Plain text
106 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
107 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
108 msgid ""
109 "A tracee first needs to be attached to the tracer. Attachment and "
110 "subsequent commands are per thread: in a multithreaded process, every thread "
111 "can be individually attached to a (potentially different) tracer, or left "
112 "not attached and thus not debugged. Therefore, \"tracee\" always means "
113 "\"(one) thread\", never \"a (possibly multithreaded) process\". Ptrace "
114 "commands are always sent to a specific tracee using a call of the form"
115 msgstr ""
116
117 #. type: Plain text
118 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
119 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
120 #, no-wrap
121 msgid "ptrace(PTRACE_foo, pid, ...)\n"
122 msgstr ""
123
124 #. type: Plain text
125 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
126 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
127 msgid "where I<pid> is the thread ID of the corresponding Linux thread."
128 msgstr ""
129
130 #. type: Plain text
131 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
132 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
133 msgid ""
134 "(Note that in this page, a \"multithreaded process\" means a thread group "
135 "consisting of threads created using the B<clone>(2) B<CLONE_THREAD> flag.)"
136 msgstr ""
137
138 #. type: Plain text
139 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
140 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
141 msgid ""
142 "A process can initiate a trace by calling B<fork>(2) and having the "
143 "resulting child do a B<PTRACE_TRACEME>, followed (typically) by an "
144 "B<execve>(2). Alternatively, one process may commence tracing another "
145 "process using B<PTRACE_ATTACH> or B<PTRACE_SEIZE>."
146 msgstr ""
147
148 #. type: Plain text
149 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
150 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
151 msgid ""
152 "While being traced, the tracee will stop each time a signal is delivered, "
153 "even if the signal is being ignored. (An exception is B<SIGKILL>, which has "
154 "its usual effect.) The tracer will be notified at its next call to "
155 "B<waitpid>(2) (or one of the related \"wait\" system calls); that call will "
156 "return a I<status> value containing information that indicates the cause of "
157 "the stop in the tracee. While the tracee is stopped, the tracer can use "
158 "various ptrace operations to inspect and modify the tracee. The tracer then "
159 "causes the tracee to continue, optionally ignoring the delivered signal (or "
160 "even delivering a different signal instead)."
161 msgstr ""
162
163 #. type: Plain text
164 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
165 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
166 msgid ""
167 "If the B<PTRACE_O_TRACEEXEC> option is not in effect, all successful calls "
168 "to B<execve>(2) by the traced process will cause it to be sent a B<SIGTRAP> "
169 "signal, giving the parent a chance to gain control before the new program "
170 "begins execution."
171 msgstr ""
172
173 #. type: Plain text
174 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
175 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
176 msgid ""
177 "When the tracer is finished tracing, it can cause the tracee to continue "
178 "executing in a normal, untraced mode via B<PTRACE_DETACH>."
179 msgstr ""
180
181 #. type: Plain text
182 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
183 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
184 msgid "The value of I<op> determines the operation to be performed:"
185 msgstr ""
186
187 #. type: TP
188 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
189 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
190 #, no-wrap
191 msgid "B<PTRACE_TRACEME>"
192 msgstr ""
193
194 #. type: Plain text
195 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
196 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
197 msgid ""
198 "Indicate that this process is to be traced by its parent. A process "
199 "probably shouldn't make this operation if its parent isn't expecting to "
200 "trace it. (I<pid>, I<addr>, and I<data> are ignored.)"
201 msgstr ""
202
203 #. type: Plain text
204 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
205 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
206 msgid ""
207 "The B<PTRACE_TRACEME> operation is used only by the tracee; the remaining "
208 "operations are used only by the tracer. In the following operations, I<pid> "
209 "specifies the thread ID of the tracee to be acted on. For operations other "
210 "than B<PTRACE_ATTACH>, B<PTRACE_SEIZE>, B<PTRACE_INTERRUPT>, and "
211 "B<PTRACE_KILL>, the tracee must be stopped."
212 msgstr ""
213
214 #. type: TP
215 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
216 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
217 #, no-wrap
218 msgid "B<PTRACE_PEEKTEXT>"
219 msgstr ""
220
221 #. type: TQ
222 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
223 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
224 #, no-wrap
225 msgid "B<PTRACE_PEEKDATA>"
226 msgstr ""
227
228 #. type: Plain text
229 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
230 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
231 msgid ""
232 "Read a word at the address I<addr> in the tracee's memory, returning the "
233 "word as the result of the B<ptrace>() call. Linux does not have separate "
234 "text and data address spaces, so these two operations are currently "
235 "equivalent. (I<data> is ignored; but see NOTES.)"
236 msgstr ""
237
238 #. type: TP
239 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
240 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
241 #, no-wrap
242 msgid "B<PTRACE_PEEKUSER>"
243 msgstr ""
244
245 #. PTRACE_PEEKUSR in kernel source, but glibc uses PTRACE_PEEKUSER,
246 #. and that is the name that seems common on other systems.
247 #. type: Plain text
248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
250 msgid ""
251 "Read a word at offset I<addr> in the tracee's USER area, which holds the "
252 "registers and other information about the process (see I<E<lt>sys/"
253 "user.hE<gt>>). The word is returned as the result of the B<ptrace>() "
254 "call. Typically, the offset must be word-aligned, though this might vary by "
255 "architecture. See NOTES. (I<data> is ignored; but see NOTES.)"
256 msgstr ""
257
258 #. type: TP
259 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
260 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
261 #, no-wrap
262 msgid "B<PTRACE_POKETEXT>"
263 msgstr ""
264
265 #. type: TQ
266 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
267 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
268 #, no-wrap
269 msgid "B<PTRACE_POKEDATA>"
270 msgstr ""
271
272 #. type: Plain text
273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
275 msgid ""
276 "Copy the word I<data> to the address I<addr> in the tracee's memory. As for "
277 "B<PTRACE_PEEKTEXT> and B<PTRACE_PEEKDATA>, these two operations are "
278 "currently equivalent."
279 msgstr ""
280
281 #. type: TP
282 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
283 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
284 #, no-wrap
285 msgid "B<PTRACE_POKEUSER>"
286 msgstr ""
287
288 #. PTRACE_POKEUSR in kernel source, but glibc uses PTRACE_POKEUSER,
289 #. and that is the name that seems common on other systems.
290 #. FIXME In the preceding sentence, which modifications are disallowed,
291 #. and when they are disallowed, how does user space discover that fact?
292 #. type: Plain text
293 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
294 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
295 msgid ""
296 "Copy the word I<data> to offset I<addr> in the tracee's USER area. As for "
297 "B<PTRACE_PEEKUSER>, the offset must typically be word-aligned. In order to "
298 "maintain the integrity of the kernel, some modifications to the USER area "
299 "are disallowed."
300 msgstr ""
301
302 #. type: TP
303 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
304 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
305 #, no-wrap
306 msgid "B<PTRACE_GETREGS>"
307 msgstr ""
308
309 #. type: TQ
310 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
311 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
312 #, no-wrap
313 msgid "B<PTRACE_GETFPREGS>"
314 msgstr ""
315
316 #. type: Plain text
317 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
318 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
319 msgid ""
320 "Copy the tracee's general-purpose or floating-point registers, respectively, "
321 "to the address I<data> in the tracer. See I<E<lt>sys/user.hE<gt>> for "
322 "information on the format of this data. (I<addr> is ignored.) Note that "
323 "SPARC systems have the meaning of I<data> and I<addr> reversed; that is, "
324 "I<data> is ignored and the registers are copied to the address I<addr>. "
325 "B<PTRACE_GETREGS> and B<PTRACE_GETFPREGS> are not present on all "
326 "architectures."
327 msgstr ""
328
329 #. type: TP
330 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
331 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
332 #, no-wrap
333 msgid "B<PTRACE_GETREGSET> (since Linux 2.6.34)"
334 msgstr ""
335
336 #. type: Plain text
337 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
338 #: opensuse-leap-16-1 opensuse-tumbleweed
339 msgid ""
340 "Read the tracee's registers. I<addr> specifies, in an architecture-"
341 "dependent way, the type of registers to be read. B<NT_PRSTATUS> (with "
342 "numerical value 1) usually results in reading of general-purpose "
343 "registers. If the CPU has, for example, floating-point and/or vector "
344 "registers, they can be retrieved by setting I<addr> to the corresponding "
345 "B<NT_foo> constant. I<data> points to a B<struct iovec>, which describes "
346 "the destination buffer's location and size. On return, the kernel modifies "
347 "B<iov.len> to indicate the actual number of bytes returned."
348 msgstr ""
349
350 #. type: TP
351 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
352 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
353 #, no-wrap
354 msgid "B<PTRACE_SETREGS>"
355 msgstr ""
356
357 #. type: TQ
358 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
359 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
360 #, no-wrap
361 msgid "B<PTRACE_SETFPREGS>"
362 msgstr ""
363
364 #. FIXME . In the preceding sentence, which modifications are disallowed,
365 #. and when they are disallowed, how does user space discover that fact?
366 #. type: Plain text
367 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
368 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
369 msgid ""
370 "Modify the tracee's general-purpose or floating-point registers, "
371 "respectively, from the address I<data> in the tracer. As for "
372 "B<PTRACE_POKEUSER>, some general-purpose register modifications may be "
373 "disallowed. (I<addr> is ignored.) Note that SPARC systems have the meaning "
374 "of I<data> and I<addr> reversed; that is, I<data> is ignored and the "
375 "registers are copied from the address I<addr>. B<PTRACE_SETREGS> and "
376 "B<PTRACE_SETFPREGS> are not present on all architectures."
377 msgstr ""
378
379 #. type: TP
380 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
381 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
382 #, no-wrap
383 msgid "B<PTRACE_SETREGSET> (since Linux 2.6.34)"
384 msgstr ""
385
386 #. type: Plain text
387 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
388 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
389 msgid ""
390 "Modify the tracee's registers. The meaning of I<addr> and I<data> is "
391 "analogous to B<PTRACE_GETREGSET>."
392 msgstr ""
393
394 #. type: TP
395 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
396 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
397 #, no-wrap
398 msgid "B<PTRACE_GETSIGINFO> (since Linux 2.3.99-pre6)"
399 msgstr ""
400
401 #. type: Plain text
402 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
403 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
404 msgid ""
405 "Retrieve information about the signal that caused the stop. Copy a "
406 "I<siginfo_t> structure (see B<sigaction>(2)) from the tracee to the address "
407 "I<data> in the tracer. (I<addr> is ignored.)"
408 msgstr ""
409
410 #. type: TP
411 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
412 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
413 #, no-wrap
414 msgid "B<PTRACE_SETSIGINFO> (since Linux 2.3.99-pre6)"
415 msgstr ""
416
417 #. type: Plain text
418 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
419 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
420 msgid ""
421 "Set signal information: copy a I<siginfo_t> structure from the address "
422 "I<data> in the tracer to the tracee. This will affect only signals that "
423 "would normally be delivered to the tracee and were caught by the tracer. It "
424 "may be difficult to tell these normal signals from synthetic signals "
425 "generated by B<ptrace>() itself. (I<addr> is ignored.)"
426 msgstr ""
427
428 #. type: TP
429 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
430 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
431 #, no-wrap
432 msgid "B<PTRACE_PEEKSIGINFO> (since Linux 3.10)"
433 msgstr ""
434
435 #. commit 84c751bd4aebbaae995fe32279d3dba48327bad4
436 #. type: Plain text
437 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
438 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
439 msgid ""
440 "Retrieve I<siginfo_t> structures without removing signals from a queue. "
441 "I<addr> points to a I<ptrace_peeksiginfo_args> structure that specifies the "
442 "ordinal position from which copying of signals should start, and the number "
443 "of signals to copy. I<siginfo_t> structures are copied into the buffer "
444 "pointed to by I<data>. The return value contains the number of copied "
445 "signals (zero indicates that there is no signal corresponding to the "
446 "specified ordinal position). Within the returned I<siginfo> structures, the "
447 "I<si_code> field includes information (B<__SI_CHLD>, B<__SI_FAULT>, etc.) "
448 "that are not otherwise exposed to user space."
449 msgstr ""
450
451 #. type: Plain text
452 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
453 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
454 #, no-wrap
455 msgid ""
456 "struct ptrace_peeksiginfo_args {\n"
457 " u64 off; /* Ordinal position in queue at which\n"
458 " to start copying signals */\n"
459 " u32 flags; /* PTRACE_PEEKSIGINFO_SHARED or 0 */\n"
460 " s32 nr; /* Number of signals to copy */\n"
461 "};\n"
462 msgstr ""
463
464 #. type: Plain text
465 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
466 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
467 msgid ""
468 "Currently, there is only one flag, B<PTRACE_PEEKSIGINFO_SHARED>, for dumping "
469 "signals from the process-wide signal queue. If this flag is not set, "
470 "signals are read from the per-thread queue of the specified thread."
471 msgstr ""
472
473 #. type: TP
474 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
475 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
476 #, no-wrap
477 msgid "B<PTRACE_GETSIGMASK> (since Linux 3.11)"
478 msgstr ""
479
480 #. commit 29000caecbe87b6b66f144f72111f0d02fbbf0c1
481 #. type: Plain text
482 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
483 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
484 msgid ""
485 "Place a copy of the mask of blocked signals (see B<sigprocmask>(2)) in the "
486 "buffer pointed to by I<data>, which should be a pointer to a buffer of type "
487 "I<sigset_t>. The I<addr> argument contains the size of the buffer pointed "
488 "to by I<data> (i.e., I<sizeof(sigset_t)>)."
489 msgstr ""
490
491 #. type: TP
492 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
493 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
494 #, no-wrap
495 msgid "B<PTRACE_SETSIGMASK> (since Linux 3.11)"
496 msgstr ""
497
498 #. type: Plain text
499 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
500 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
501 msgid ""
502 "Change the mask of blocked signals (see B<sigprocmask>(2)) to the value "
503 "specified in the buffer pointed to by I<data>, which should be a pointer to "
504 "a buffer of type I<sigset_t>. The I<addr> argument contains the size of the "
505 "buffer pointed to by I<data> (i.e., I<sizeof(sigset_t)>)."
506 msgstr ""
507
508 #. type: TP
509 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
510 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
511 #, no-wrap
512 msgid "B<PTRACE_SETOPTIONS> (since Linux 2.4.6; see BUGS for caveats)"
513 msgstr ""
514
515 #. type: Plain text
516 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
517 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
518 msgid ""
519 "Set ptrace options from I<data>. (I<addr> is ignored.) I<data> is "
520 "interpreted as a bit mask of options, which are specified by the following "
521 "flags:"
522 msgstr ""
523
524 #. type: TP
525 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
526 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
527 #, no-wrap
528 msgid "B<PTRACE_O_EXITKILL> (since Linux 3.8)"
529 msgstr ""
530
531 #. commit 992fb6e170639b0849bace8e49bf31bd37c4123
532 #. type: Plain text
533 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
534 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
535 msgid ""
536 "Send a B<SIGKILL> signal to the tracee if the tracer exits. This option is "
537 "useful for ptrace jailers that want to ensure that tracees can never escape "
538 "the tracer's control."
539 msgstr ""
540
541 #. type: TP
542 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
543 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
544 #, no-wrap
545 msgid "B<PTRACE_O_TRACECLONE> (since Linux 2.5.46)"
546 msgstr ""
547
548 #. type: Plain text
549 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
550 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
551 msgid ""
552 "Stop the tracee at the next B<clone>(2) and automatically start tracing the "
553 "newly cloned process, which will start with a B<SIGSTOP>, or "
554 "B<PTRACE_EVENT_STOP> if B<PTRACE_SEIZE> was used. A B<waitpid>(2) by the "
555 "tracer will return a I<status> value such that"
556 msgstr ""
557
558 #. type: Plain text
559 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
560 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
561 #, no-wrap
562 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_CLONEE<lt>E<lt>8))\n"
563 msgstr ""
564
565 #. type: Plain text
566 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
567 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
568 msgid "The PID of the new process can be retrieved with B<PTRACE_GETEVENTMSG>."
569 msgstr ""
570
571 #. type: Plain text
572 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
573 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
574 msgid ""
575 "This option may not catch B<clone>(2) calls in all cases. If the tracee "
576 "calls B<clone>(2) with the B<CLONE_VFORK> flag, B<PTRACE_EVENT_VFORK> will "
577 "be delivered instead if B<PTRACE_O_TRACEVFORK> is set; otherwise if the "
578 "tracee calls B<clone>(2) with the exit signal set to B<SIGCHLD>, "
579 "B<PTRACE_EVENT_FORK> will be delivered if B<PTRACE_O_TRACEFORK> is set."
580 msgstr ""
581
582 #. type: TP
583 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
584 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
585 #, no-wrap
586 msgid "B<PTRACE_O_TRACEEXEC> (since Linux 2.5.46)"
587 msgstr ""
588
589 #. type: Plain text
590 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
591 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
592 msgid ""
593 "Stop the tracee at the next B<execve>(2). A B<waitpid>(2) by the tracer "
594 "will return a I<status> value such that"
595 msgstr ""
596
597 #. type: Plain text
598 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
599 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
600 #, no-wrap
601 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_EXECE<lt>E<lt>8))\n"
602 msgstr ""
603
604 #. type: Plain text
605 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
606 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
607 msgid ""
608 "If the execing thread is not a thread group leader, the thread ID is reset "
609 "to thread group leader's ID before this stop. Since Linux 3.0, the former "
610 "thread ID can be retrieved with B<PTRACE_GETEVENTMSG>."
611 msgstr ""
612
613 #. type: TP
614 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
615 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
616 #, no-wrap
617 msgid "B<PTRACE_O_TRACEEXIT> (since Linux 2.5.60)"
618 msgstr ""
619
620 #. type: Plain text
621 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
622 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
623 msgid ""
624 "Stop the tracee at exit. A B<waitpid>(2) by the tracer will return a "
625 "I<status> value such that"
626 msgstr ""
627
628 #. type: Plain text
629 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
630 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
631 #, no-wrap
632 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_EXITE<lt>E<lt>8))\n"
633 msgstr ""
634
635 #. type: Plain text
636 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
637 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
638 msgid "The tracee's exit status can be retrieved with B<PTRACE_GETEVENTMSG>."
639 msgstr ""
640
641 #. type: Plain text
642 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
643 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
644 msgid ""
645 "The tracee is stopped early during process exit, when registers are still "
646 "available, allowing the tracer to see where the exit occurred, whereas the "
647 "normal exit notification is done after the process is finished exiting. "
648 "Even though context is available, the tracer cannot prevent the exit from "
649 "happening at this point."
650 msgstr ""
651
652 #. type: TP
653 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
654 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
655 #, no-wrap
656 msgid "B<PTRACE_O_TRACEFORK> (since Linux 2.5.46)"
657 msgstr ""
658
659 #. type: Plain text
660 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
661 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
662 msgid ""
663 "Stop the tracee at the next B<fork>(2) and automatically start tracing the "
664 "newly forked process, which will start with a B<SIGSTOP>, or "
665 "B<PTRACE_EVENT_STOP> if B<PTRACE_SEIZE> was used. A B<waitpid>(2) by the "
666 "tracer will return a I<status> value such that"
667 msgstr ""
668
669 #. type: Plain text
670 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
671 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
672 #, no-wrap
673 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_FORKE<lt>E<lt>8))\n"
674 msgstr ""
675
676 #. type: TP
677 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
678 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
679 #, no-wrap
680 msgid "B<PTRACE_O_TRACESYSGOOD> (since Linux 2.4.6)"
681 msgstr ""
682
683 #. type: Plain text
684 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
685 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
686 msgid ""
687 "When delivering system call traps, set bit 7 in the signal number (i.e., "
688 "deliver I<SIGTRAP|0x80>). This makes it easy for the tracer to distinguish "
689 "normal traps from those caused by a system call."
690 msgstr ""
691
692 #. type: TP
693 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
694 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
695 #, no-wrap
696 msgid "B<PTRACE_O_TRACEVFORK> (since Linux 2.5.46)"
697 msgstr ""
698
699 #. type: Plain text
700 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
701 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
702 msgid ""
703 "Stop the tracee at the next B<vfork>(2) and automatically start tracing the "
704 "newly vforked process, which will start with a B<SIGSTOP>, or "
705 "B<PTRACE_EVENT_STOP> if B<PTRACE_SEIZE> was used. A B<waitpid>(2) by the "
706 "tracer will return a I<status> value such that"
707 msgstr ""
708
709 #. type: Plain text
710 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
711 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
712 #, no-wrap
713 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_VFORKE<lt>E<lt>8))\n"
714 msgstr ""
715
716 #. type: TP
717 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
718 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
719 #, no-wrap
720 msgid "B<PTRACE_O_TRACEVFORKDONE> (since Linux 2.5.60)"
721 msgstr ""
722
723 #. type: Plain text
724 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
725 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
726 msgid ""
727 "Stop the tracee at the completion of the next B<vfork>(2). A B<waitpid>(2) "
728 "by the tracer will return a I<status> value such that"
729 msgstr ""
730
731 #. type: Plain text
732 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
733 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
734 #, no-wrap
735 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_VFORK_DONEE<lt>E<lt>8))\n"
736 msgstr ""
737
738 #. type: Plain text
739 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
740 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
741 msgid ""
742 "The PID of the new process can (since Linux 2.6.18) be retrieved with "
743 "B<PTRACE_GETEVENTMSG>."
744 msgstr ""
745
746 #. type: TP
747 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
748 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
749 #, no-wrap
750 msgid "B<PTRACE_O_TRACESECCOMP> (since Linux 3.5)"
751 msgstr ""
752
753 #. type: Plain text
754 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
755 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
756 msgid ""
757 "Stop the tracee when a B<seccomp>(2) B<SECCOMP_RET_TRACE> rule is "
758 "triggered. A B<waitpid>(2) by the tracer will return a I<status> value "
759 "such that"
760 msgstr ""
761
762 #. type: Plain text
763 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
764 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
765 #, no-wrap
766 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_SECCOMPE<lt>E<lt>8))\n"
767 msgstr ""
768
769 #. type: Plain text
770 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
771 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
772 msgid ""
773 "While this triggers a B<PTRACE_EVENT> stop, it is similar to a syscall-enter-"
774 "stop. For details, see the note on B<PTRACE_EVENT_SECCOMP> below. The "
775 "seccomp event message data (from the B<SECCOMP_RET_DATA> portion of the "
776 "seccomp filter rule) can be retrieved with B<PTRACE_GETEVENTMSG>."
777 msgstr ""
778
779 #. type: TP
780 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
781 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
782 #, no-wrap
783 msgid "B<PTRACE_O_SUSPEND_SECCOMP> (since Linux 4.3)"
784 msgstr ""
785
786 #. commit 13c4a90119d28cfcb6b5bdd820c233b86c2b0237
787 #. type: Plain text
788 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
789 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
790 msgid ""
791 "Suspend the tracee's seccomp protections. This applies regardless of mode, "
792 "and can be used when the tracee has not yet installed seccomp filters. That "
793 "is, a valid use case is to suspend a tracee's seccomp protections before "
794 "they are installed by the tracee, let the tracee install the filters, and "
795 "then clear this flag when the filters should be resumed. Setting this "
796 "option requires that the tracer have the B<CAP_SYS_ADMIN> capability, not "
797 "have any seccomp protections installed, and not have "
798 "B<PTRACE_O_SUSPEND_SECCOMP> set on itself."
799 msgstr ""
800
801 #. type: TP
802 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
803 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
804 #, no-wrap
805 msgid "B<PTRACE_GETEVENTMSG> (since Linux 2.5.46)"
806 msgstr ""
807
808 #. type: Plain text
809 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
810 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
811 msgid ""
812 "Retrieve a message (as an I<unsigned long>) about the ptrace event that "
813 "just happened, placing it at the address I<data> in the tracer. For "
814 "B<PTRACE_EVENT_EXIT>, this is the tracee's exit status. For "
815 "B<PTRACE_EVENT_FORK>, B<PTRACE_EVENT_VFORK>, B<PTRACE_EVENT_VFORK_DONE>, and "
816 "B<PTRACE_EVENT_CLONE>, this is the PID of the new process. For "
817 "B<PTRACE_EVENT_SECCOMP>, this is the B<seccomp>(2) filter's "
818 "B<SECCOMP_RET_DATA> associated with the triggered rule. (I<addr> is "
819 "ignored.)"
820 msgstr ""
821
822 #. type: TP
823 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
824 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
825 #, no-wrap
826 msgid "B<PTRACE_CONT>"
827 msgstr ""
828
829 #. type: Plain text
830 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
831 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
832 msgid ""
833 "Restart the stopped tracee process. If I<data> is nonzero, it is "
834 "interpreted as the number of a signal to be delivered to the tracee; "
835 "otherwise, no signal is delivered. Thus, for example, the tracer can "
836 "control whether a signal sent to the tracee is delivered or not. (I<addr> "
837 "is ignored.)"
838 msgstr ""
839
840 #. type: TP
841 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
842 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
843 #, no-wrap
844 msgid "B<PTRACE_SYSCALL>"
845 msgstr ""
846
847 #. type: TQ
848 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
849 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
850 #, no-wrap
851 msgid "B<PTRACE_SINGLESTEP>"
852 msgstr ""
853
854 #. type: Plain text
855 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
856 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
857 msgid ""
858 "Restart the stopped tracee as for B<PTRACE_CONT>, but arrange for the tracee "
859 "to be stopped at the next entry to or exit from a system call, or after "
860 "execution of a single instruction, respectively. (The tracee will also, as "
861 "usual, be stopped upon receipt of a signal.) From the tracer's perspective, "
862 "the tracee will appear to have been stopped by receipt of a B<SIGTRAP>. So, "
863 "for B<PTRACE_SYSCALL>, for example, the idea is to inspect the arguments to "
864 "the system call at the first stop, then do another B<PTRACE_SYSCALL> and "
865 "inspect the return value of the system call at the second stop. The I<data> "
866 "argument is treated as for B<PTRACE_CONT>. (I<addr> is ignored.)"
867 msgstr ""
868
869 #. type: TP
870 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
871 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
872 #, no-wrap
873 msgid "B<PTRACE_SET_SYSCALL> (since Linux 2.6.16)"
874 msgstr ""
875
876 #. commit 3f471126ee53feb5e9b210ea2f525ed3bb9b7a7f
877 #. As of 4.19-rc2
878 #. commit 27aa55c5e5123fa8b8ad0156559d34d7edff58ca
879 #. see change_syscall in tools/testing/selftests/seccomp/seccomp_bpf.c
880 #. and also strace's linux/*/set_scno.c files.
881 #. type: Plain text
882 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
883 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
884 msgid ""
885 "When in syscall-enter-stop, change the number of the system call that is "
886 "about to be executed to the number specified in the I<data> argument. The "
887 "I<addr> argument is ignored. This operation is currently supported only on "
888 "arm (and arm64, though only for backwards compatibility), but most other "
889 "architectures have other means of accomplishing this (usually by changing "
890 "the register that the userland code passed the system call number in)."
891 msgstr ""
892
893 #. type: TP
894 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
895 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
896 #, no-wrap
897 msgid "B<PTRACE_SYSEMU>"
898 msgstr ""
899
900 #. type: TQ
901 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
902 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
903 #, no-wrap
904 msgid "B<PTRACE_SYSEMU_SINGLESTEP> (since Linux 2.6.14)"
905 msgstr ""
906
907 #. As at 3.7
908 #. type: Plain text
909 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
910 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
911 msgid ""
912 "For B<PTRACE_SYSEMU>, continue and stop on entry to the next system call, "
913 "which will not be executed. See the documentation on syscall-stops below. "
914 "For B<PTRACE_SYSEMU_SINGLESTEP>, do the same but also singlestep if not a "
915 "system call. This call is used by programs like User Mode Linux that want "
916 "to emulate all the tracee's system calls. The I<data> argument is treated "
917 "as for B<PTRACE_CONT>. The I<addr> argument is ignored. These operations "
918 "are currently supported only on x86."
919 msgstr ""
920
921 #. type: TP
922 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
923 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
924 #, no-wrap
925 msgid "B<PTRACE_LISTEN> (since Linux 3.4)"
926 msgstr ""
927
928 #. type: Plain text
929 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
930 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
931 msgid ""
932 "Restart the stopped tracee, but prevent it from executing. The resulting "
933 "state of the tracee is similar to a process which has been stopped by a "
934 "B<SIGSTOP> (or other stopping signal). See the \"group-stop\" subsection "
935 "for additional information. B<PTRACE_LISTEN> works only on tracees attached "
936 "by B<PTRACE_SEIZE>."
937 msgstr ""
938
939 #. type: TP
940 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
941 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
942 #, no-wrap
943 msgid "B<PTRACE_KILL>"
944 msgstr ""
945
946 #. type: Plain text
947 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
948 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
949 msgid ""
950 "Send the tracee a B<SIGKILL> to terminate it. (I<addr> and I<data> are "
951 "ignored.)"
952 msgstr ""
953
954 #. #-#-#-#-# archlinux: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
955 #. [Note from Denys Vlasenko:
956 #. deprecation suggested by Oleg Nesterov. He prefers to deprecate it
957 #. instead of describing (and needing to support) PTRACE_KILL's quirks.]
958 #. type: Plain text
959 #. #-#-#-#-# debian-trixie: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
960 #. [Note from Denys Vlasenko:
961 #. deprecation suggested by Oleg Nesterov. He prefers to deprecate it
962 #. instead of describing (and needing to support) PTRACE_KILL's quirks.]
963 #. type: Plain text
964 #. #-#-#-#-# debian-unstable: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
965 #. [Note from Denys Vlasenko:
966 #. deprecation suggested by Oleg Nesterov. He prefers to deprecate it
967 #. instead of describing (and needing to support) PTRACE_KILL's quirks.]
968 #. type: Plain text
969 #. #-#-#-#-# fedora-44: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
970 #. [Note from Denys Vlasenko:
971 #. deprecation suggested by Oleg Nesterov. He prefers to deprecate it
972 #. instead of describing (and needing to support) PTRACE_KILL's quirks.]
973 #. type: Plain text
974 #. #-#-#-#-# fedora-rawhide: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
975 #. [Note from Denys Vlasenko:
976 #. deprecation suggested by Oleg Nesterov. He prefers to deprecate it
977 #. instead of describing (and needing to support) PTRACE_KILL's quirks.]
978 #. type: Plain text
979 #. #-#-#-#-# mageia-cauldron: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
980 #. [Note from Denys Vlasenko:
981 #. deprecation suggested by Oleg Nesterov. He prefers to deprecate it
982 #. instead of describing (and needing to support) PTRACE_KILL's quirks.]
983 #. type: Plain text
984 #. #-#-#-#-# opensuse-leap-16-1: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
985 #. [Note from Denys Vlasenko:
986 #. deprecation suggested by Oleg Nesterov. He prefers to deprecate it
987 #. instead of describing (and needing to support) PTRACE_KILL's quirks.]
988 #. type: Plain text
989 #. #-#-#-#-# opensuse-tumbleweed: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
990 #. [Note from Denys Vlasenko:
991 #. deprecation suggested by Oleg Nesterov. He prefers to deprecate it
992 #. instead of describing (and needing to support) PTRACE_KILL's quirks.]
993 #. type: Plain text
994 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
995 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
996 msgid ""
997 "I<This operation is deprecated; do not use it!> Instead, send a B<SIGKILL> "
998 "directly using B<kill>(2) or B<tgkill>(2). The problem with B<PTRACE_KILL> "
999 "is that it requires the tracee to be in signal-delivery-stop, otherwise it "
1000 "may not work (i.e., may complete successfully but won't kill the tracee). "
1001 "By contrast, sending a B<SIGKILL> directly has no such limitation."
1002 msgstr ""
1003
1004 #. type: TP
1005 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1006 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1007 #, no-wrap
1008 msgid "B<PTRACE_INTERRUPT> (since Linux 3.4)"
1009 msgstr ""
1010
1011 #. type: Plain text
1012 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1013 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1014 msgid ""
1015 "Stop a tracee. If the tracee is running or sleeping in kernel space and "
1016 "B<PTRACE_SYSCALL> is in effect, the system call is interrupted and syscall-"
1017 "exit-stop is reported. (The interrupted system call is restarted when the "
1018 "tracee is restarted.) If the tracee was already stopped by a signal and "
1019 "B<PTRACE_LISTEN> was sent to it, the tracee stops with B<PTRACE_EVENT_STOP> "
1020 "and I<WSTOPSIG(status)> returns the stop signal. If any other ptrace-stop "
1021 "is generated at the same time (for example, if a signal is sent to the "
1022 "tracee), this ptrace-stop happens. If none of the above applies (for "
1023 "example, if the tracee is running in user space), it stops with "
1024 "B<PTRACE_EVENT_STOP> with I<WSTOPSIG(status)> == B<SIGTRAP>. "
1025 "B<PTRACE_INTERRUPT> only works on tracees attached by B<PTRACE_SEIZE>."
1026 msgstr ""
1027
1028 #. type: TP
1029 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1030 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1031 #, no-wrap
1032 msgid "B<PTRACE_ATTACH>"
1033 msgstr ""
1034
1035 #. #-#-#-#-# archlinux: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
1036 #. No longer true (removed by Denys Vlasenko, 2011, who remarks:
1037 #. "I think it isn't true in non-ancient 2.4 and in Linux 2.6/3.x.
1038 #. Basically, it's not true for any Linux in practical use.
1039 #. the behavior of the tracee is as if it had done a
1040 #. .BR PTRACE_TRACEME .
1041 #. The calling process actually becomes the parent of the tracee
1042 #. process for most purposes (e.g., it will receive
1043 #. notification of tracee events and appears in
1044 #. .BR ps (1)
1045 #. output as the tracee's parent), but a
1046 #. .BR getppid (2)
1047 #. by the tracee will still return the PID of the original parent.
1048 #. type: Plain text
1049 #. #-#-#-#-# debian-trixie: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
1050 #. No longer true (removed by Denys Vlasenko, 2011, who remarks:
1051 #. "I think it isn't true in non-ancient 2.4 and in Linux 2.6/3.x.
1052 #. Basically, it's not true for any Linux in practical use.
1053 #. ; the behavior of the tracee is as if it had done a
1054 #. .BR PTRACE_TRACEME .
1055 #. The calling process actually becomes the parent of the tracee
1056 #. process for most purposes (e.g., it will receive
1057 #. notification of tracee events and appears in
1058 #. .BR ps (1)
1059 #. output as the tracee's parent), but a
1060 #. .BR getppid (2)
1061 #. by the tracee will still return the PID of the original parent.
1062 #. type: Plain text
1063 #. #-#-#-#-# debian-unstable: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
1064 #. No longer true (removed by Denys Vlasenko, 2011, who remarks:
1065 #. "I think it isn't true in non-ancient 2.4 and in Linux 2.6/3.x.
1066 #. Basically, it's not true for any Linux in practical use.
1067 #. the behavior of the tracee is as if it had done a
1068 #. .BR PTRACE_TRACEME .
1069 #. The calling process actually becomes the parent of the tracee
1070 #. process for most purposes (e.g., it will receive
1071 #. notification of tracee events and appears in
1072 #. .BR ps (1)
1073 #. output as the tracee's parent), but a
1074 #. .BR getppid (2)
1075 #. by the tracee will still return the PID of the original parent.
1076 #. type: Plain text
1077 #. #-#-#-#-# fedora-44: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
1078 #. No longer true (removed by Denys Vlasenko, 2011, who remarks:
1079 #. "I think it isn't true in non-ancient 2.4 and in Linux 2.6/3.x.
1080 #. Basically, it's not true for any Linux in practical use.
1081 #. ; the behavior of the tracee is as if it had done a
1082 #. .BR PTRACE_TRACEME .
1083 #. The calling process actually becomes the parent of the tracee
1084 #. process for most purposes (e.g., it will receive
1085 #. notification of tracee events and appears in
1086 #. .BR ps (1)
1087 #. output as the tracee's parent), but a
1088 #. .BR getppid (2)
1089 #. by the tracee will still return the PID of the original parent.
1090 #. type: Plain text
1091 #. #-#-#-#-# fedora-rawhide: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
1092 #. No longer true (removed by Denys Vlasenko, 2011, who remarks:
1093 #. "I think it isn't true in non-ancient 2.4 and in Linux 2.6/3.x.
1094 #. Basically, it's not true for any Linux in practical use.
1095 #. ; the behavior of the tracee is as if it had done a
1096 #. .BR PTRACE_TRACEME .
1097 #. The calling process actually becomes the parent of the tracee
1098 #. process for most purposes (e.g., it will receive
1099 #. notification of tracee events and appears in
1100 #. .BR ps (1)
1101 #. output as the tracee's parent), but a
1102 #. .BR getppid (2)
1103 #. by the tracee will still return the PID of the original parent.
1104 #. type: Plain text
1105 #. #-#-#-#-# mageia-cauldron: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
1106 #. No longer true (removed by Denys Vlasenko, 2011, who remarks:
1107 #. "I think it isn't true in non-ancient 2.4 and in Linux 2.6/3.x.
1108 #. Basically, it's not true for any Linux in practical use.
1109 #. the behavior of the tracee is as if it had done a
1110 #. .BR PTRACE_TRACEME .
1111 #. The calling process actually becomes the parent of the tracee
1112 #. process for most purposes (e.g., it will receive
1113 #. notification of tracee events and appears in
1114 #. .BR ps (1)
1115 #. output as the tracee's parent), but a
1116 #. .BR getppid (2)
1117 #. by the tracee will still return the PID of the original parent.
1118 #. type: Plain text
1119 #. #-#-#-#-# opensuse-leap-16-1: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
1120 #. No longer true (removed by Denys Vlasenko, 2011, who remarks:
1121 #. "I think it isn't true in non-ancient 2.4 and in Linux 2.6/3.x.
1122 #. Basically, it's not true for any Linux in practical use.
1123 #. the behavior of the tracee is as if it had done a
1124 #. .BR PTRACE_TRACEME .
1125 #. The calling process actually becomes the parent of the tracee
1126 #. process for most purposes (e.g., it will receive
1127 #. notification of tracee events and appears in
1128 #. .BR ps (1)
1129 #. output as the tracee's parent), but a
1130 #. .BR getppid (2)
1131 #. by the tracee will still return the PID of the original parent.
1132 #. type: Plain text
1133 #. #-#-#-#-# opensuse-tumbleweed: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
1134 #. No longer true (removed by Denys Vlasenko, 2011, who remarks:
1135 #. "I think it isn't true in non-ancient 2.4 and in Linux 2.6/3.x.
1136 #. Basically, it's not true for any Linux in practical use.
1137 #. the behavior of the tracee is as if it had done a
1138 #. .BR PTRACE_TRACEME .
1139 #. The calling process actually becomes the parent of the tracee
1140 #. process for most purposes (e.g., it will receive
1141 #. notification of tracee events and appears in
1142 #. .BR ps (1)
1143 #. output as the tracee's parent), but a
1144 #. .BR getppid (2)
1145 #. by the tracee will still return the PID of the original parent.
1146 #. type: Plain text
1147 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1148 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1149 msgid ""
1150 "Attach to the process specified in I<pid>, making it a tracee of the calling "
1151 "process. The tracee is sent a B<SIGSTOP>, but will not necessarily have "
1152 "stopped by the completion of this call; use B<waitpid>(2) to wait for the "
1153 "tracee to stop. See the \"Attaching and detaching\" subsection for "
1154 "additional information. (I<addr> and I<data> are ignored.)"
1155 msgstr ""
1156
1157 #. type: Plain text
1158 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1159 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1160 msgid ""
1161 "Permission to perform a B<PTRACE_ATTACH> is governed by a ptrace access mode "
1162 "B<PTRACE_MODE_ATTACH_REALCREDS> check; see below."
1163 msgstr ""
1164
1165 #. type: TP
1166 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1167 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1168 #, no-wrap
1169 msgid "B<PTRACE_SEIZE> (since Linux 3.4)"
1170 msgstr ""
1171
1172 #
1173 #
1174 #
1175 #. Noted by Dmitry Levin:
1176 #. PTRACE_SEIZE was introduced by commit v3.1-rc1~308^2~28, but
1177 #. it had to be used along with a temporary flag PTRACE_SEIZE_DEVEL,
1178 #. which was removed later by commit v3.4-rc1~109^2~20.
1179 #. That is, [before] v3.4 we had a test mode of PTRACE_SEIZE API,
1180 #. which was not compatible with the current PTRACE_SEIZE API introduced
1181 #. in Linux 3.4.
1182 #. type: Plain text
1183 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1184 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1185 msgid ""
1186 "Attach to the process specified in I<pid>, making it a tracee of the calling "
1187 "process. Unlike B<PTRACE_ATTACH>, B<PTRACE_SEIZE> does not stop the "
1188 "process. Group-stops are reported as B<PTRACE_EVENT_STOP> and "
1189 "I<WSTOPSIG(status)> returns the stop signal. Automatically attached "
1190 "children stop with B<PTRACE_EVENT_STOP> and I<WSTOPSIG(status)> returns "
1191 "B<SIGTRAP> instead of having B<SIGSTOP> signal delivered to them. "
1192 "B<execve>(2) does not deliver an extra B<SIGTRAP>. Only a B<PTRACE_SEIZE>d "
1193 "process can accept B<PTRACE_INTERRUPT> and B<PTRACE_LISTEN> commands. The "
1194 "\"seized\" behavior just described is inherited by children that are "
1195 "automatically attached using B<PTRACE_O_TRACEFORK>, B<PTRACE_O_TRACEVFORK>, "
1196 "and B<PTRACE_O_TRACECLONE>. I<addr> must be zero. I<data> contains a bit "
1197 "mask of ptrace options to activate immediately."
1198 msgstr ""
1199
1200 #. type: Plain text
1201 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1202 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1203 msgid ""
1204 "Permission to perform a B<PTRACE_SEIZE> is governed by a ptrace access mode "
1205 "B<PTRACE_MODE_ATTACH_REALCREDS> check; see below."
1206 msgstr ""
1207
1208 #. type: TP
1209 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1210 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1211 #, no-wrap
1212 msgid "B<PTRACE_SECCOMP_GET_FILTER> (since Linux 4.4)"
1213 msgstr ""
1214
1215 #. commit f8e529ed941ba2bbcbf310b575d968159ce7e895
1216 #. type: Plain text
1217 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1218 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1219 msgid ""
1220 "This operation allows the tracer to dump the tracee's classic BPF filters."
1221 msgstr ""
1222
1223 #. type: Plain text
1224 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1225 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1226 msgid ""
1227 "I<addr> is an integer specifying the index of the filter to be dumped. The "
1228 "most recently installed filter has the index 0. If I<addr> is greater than "
1229 "the number of installed filters, the operation fails with the error "
1230 "B<ENOENT>."
1231 msgstr ""
1232
1233 #. type: Plain text
1234 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1235 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1236 msgid ""
1237 "I<data> is either a pointer to a I<struct sock_filter> array that is large "
1238 "enough to store the BPF program, or NULL if the program is not to be stored."
1239 msgstr ""
1240
1241 #. type: Plain text
1242 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1243 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1244 msgid ""
1245 "Upon success, the return value is the number of instructions in the BPF "
1246 "program. If I<data> was NULL, then this return value can be used to "
1247 "correctly size the I<struct sock_filter> array passed in a subsequent call."
1248 msgstr ""
1249
1250 #. type: Plain text
1251 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1252 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1253 msgid ""
1254 "This operation fails with the error B<EACCES> if the caller does not have "
1255 "the B<CAP_SYS_ADMIN> capability or if the caller is in strict or filter "
1256 "seccomp mode. If the filter referred to by I<addr> is not a classic BPF "
1257 "filter, the operation fails with the error B<EMEDIUMTYPE>."
1258 msgstr ""
1259
1260 #. type: Plain text
1261 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1262 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1263 msgid ""
1264 "This operation is available if the kernel was configured with both the "
1265 "B<CONFIG_SECCOMP_FILTER> and the B<CONFIG_CHECKPOINT_RESTORE> options."
1266 msgstr ""
1267
1268 #. type: TP
1269 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1270 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1271 #, no-wrap
1272 msgid "B<PTRACE_DETACH>"
1273 msgstr ""
1274
1275 #. type: Plain text
1276 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1277 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1278 msgid ""
1279 "Restart the stopped tracee as for B<PTRACE_CONT>, but first detach from it. "
1280 "Under Linux, a tracee can be detached in this way regardless of which method "
1281 "was used to initiate tracing. (I<addr> is ignored.)"
1282 msgstr ""
1283
1284 #. type: TP
1285 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1286 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1287 #, no-wrap
1288 msgid "B<PTRACE_GET_THREAD_AREA> (since Linux 2.6.0)"
1289 msgstr ""
1290
1291 #. type: Plain text
1292 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1293 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1294 msgid ""
1295 "This operation performs a similar task to B<get_thread_area>(2). It reads "
1296 "the TLS entry in the GDT whose index is given in I<addr>, placing a copy of "
1297 "the entry into the I<struct user_desc> pointed to by I<data>. (By contrast "
1298 "with B<get_thread_area>(2), the I<entry_number> of the I<struct user_desc> "
1299 "is ignored.)"
1300 msgstr ""
1301
1302 #. type: TP
1303 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1304 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1305 #, no-wrap
1306 msgid "B<PTRACE_SET_THREAD_AREA> (since Linux 2.6.0)"
1307 msgstr ""
1308
1309 #. type: Plain text
1310 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1311 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1312 msgid ""
1313 "This operation performs a similar task to B<set_thread_area>(2). It sets "
1314 "the TLS entry in the GDT whose index is given in I<addr>, assigning it the "
1315 "data supplied in the I<struct user_desc> pointed to by I<data>. (By "
1316 "contrast with B<set_thread_area>(2), the I<entry_number> of the I<struct "
1317 "user_desc> is ignored; in other words, this ptrace operation can't be used "
1318 "to allocate a free TLS entry.)"
1319 msgstr ""
1320
1321 #. type: TP
1322 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1323 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1324 #, no-wrap
1325 msgid "B<PTRACE_GET_SYSCALL_INFO> (since Linux 5.3)"
1326 msgstr ""
1327
1328 #. commit 201766a20e30f982ccfe36bebfad9602c3ff574a
1329 #. type: Plain text
1330 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1331 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1332 msgid ""
1333 "Retrieve information about the system call that caused the stop. The "
1334 "information is placed into the buffer pointed by the I<data> argument, which "
1335 "should be a pointer to a buffer of type I<struct ptrace_syscall_info>. The "
1336 "I<addr> argument contains the size of the buffer pointed to by the I<data> "
1337 "argument (i.e., I<sizeof(struct ptrace_syscall_info)>). The return value "
1338 "contains the number of bytes available to be written by the kernel. If the "
1339 "size of the data to be written by the kernel exceeds the size specified by "
1340 "the I<addr> argument, the output data is truncated."
1341 msgstr ""
1342
1343 #. type: Plain text
1344 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1345 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1346 msgid "The I<ptrace_syscall_info> structure contains the following fields:"
1347 msgstr ""
1348
1349 #. type: Plain text
1350 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1351 #: opensuse-tumbleweed
1352 #, no-wrap
1353 msgid ""
1354 "struct ptrace_syscall_info {\n"
1355 " __u8 op; /* Type of system call stop */\n"
1356 " __u8 reserved; /* Reserved for future use, must be zero */\n"
1357 " __u16 flags; /* Reserved for future use, must be zero */\n"
1358 " __u32 arch; /* AUDIT_ARCH_* value; see seccomp(2) */\n"
1359 " __u64 instruction_pointer; /* CPU instruction pointer */\n"
1360 " __u64 stack_pointer; /* CPU stack pointer */\n"
1361 " union {\n"
1362 " struct { /* op == PTRACE_SYSCALL_INFO_ENTRY */\n"
1363 " __u64 nr; /* System call number */\n"
1364 " __u64 args[6]; /* System call arguments */\n"
1365 " } entry;\n"
1366 " struct { /* op == PTRACE_SYSCALL_INFO_EXIT */\n"
1367 " __s64 rval; /* System call return value */\n"
1368 " __u8 is_error; /* System call error flag;\n"
1369 " Boolean: does rval contain\n"
1370 " an error value (-ERRCODE) or\n"
1371 " a nonerror return value? */\n"
1372 " } exit;\n"
1373 " struct { /* op == PTRACE_SYSCALL_INFO_SECCOMP */\n"
1374 " __u64 nr; /* System call number */\n"
1375 " __u64 args[6]; /* System call arguments */\n"
1376 " __u32 ret_data; /* SECCOMP_RET_DATA portion\n"
1377 " of SECCOMP_RET_TRACE\n"
1378 " return value */\n"
1379 " } seccomp;\n"
1380 " };\n"
1381 "};\n"
1382 msgstr ""
1383
1384 #. type: Plain text
1385 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1386 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1387 msgid ""
1388 "The I<op>, I<arch>, I<instruction_pointer>, and I<stack_pointer> fields are "
1389 "defined for all kinds of ptrace system call stops. The rest of the "
1390 "structure is a union; one should read only those fields that are meaningful "
1391 "for the kind of system call stop specified by the I<op> field."
1392 msgstr ""
1393
1394 #. type: Plain text
1395 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1396 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1397 msgid ""
1398 "The I<op> field has one of the following values (defined in I<E<lt>linux/"
1399 "ptrace.hE<gt>>) indicating what type of stop occurred and which part of the "
1400 "union is filled:"
1401 msgstr ""
1402
1403 #. type: TP
1404 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1405 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1406 #, no-wrap
1407 msgid "B<PTRACE_SYSCALL_INFO_ENTRY>"
1408 msgstr ""
1409
1410 #. type: Plain text
1411 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1412 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1413 msgid ""
1414 "The I<entry> component of the union contains information relating to a "
1415 "system call entry stop."
1416 msgstr ""
1417
1418 #. type: TP
1419 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1420 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1421 #, no-wrap
1422 msgid "B<PTRACE_SYSCALL_INFO_EXIT>"
1423 msgstr ""
1424
1425 #. type: Plain text
1426 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1427 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1428 msgid ""
1429 "The I<exit> component of the union contains information relating to a system "
1430 "call exit stop."
1431 msgstr ""
1432
1433 #. type: TP
1434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1436 #, no-wrap
1437 msgid "B<PTRACE_SYSCALL_INFO_SECCOMP>"
1438 msgstr ""
1439
1440 #. type: Plain text
1441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1443 msgid ""
1444 "The I<seccomp> component of the union contains information relating to a "
1445 "B<PTRACE_EVENT_SECCOMP> stop."
1446 msgstr ""
1447
1448 #. type: TP
1449 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1450 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1451 #, no-wrap
1452 msgid "B<PTRACE_SYSCALL_INFO_NONE>"
1453 msgstr ""
1454
1455 #. type: Plain text
1456 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1457 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1458 msgid "No component of the union contains relevant information."
1459 msgstr ""
1460
1461 #. type: Plain text
1462 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1463 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1464 msgid ""
1465 "In case of system call entry or exit stops, the data returned by "
1466 "B<PTRACE_GET_SYSCALL_INFO> is limited to type B<PTRACE_SYSCALL_INFO_NONE> "
1467 "unless B<PTRACE_O_TRACESYSGOOD> option is set before the corresponding "
1468 "system call stop has occurred."
1469 msgstr ""
1470
1471 #. type: TP
1472 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1473 #: opensuse-tumbleweed
1474 #, no-wrap
1475 msgid "B<PTRACE_SET_SYSCALL_INFO> (since Linux 6.16)"
1476 msgstr ""
1477
1478 #. commit 26bb32768fe6552de044f782a58b3272073fbfc0
1479 #. type: Plain text
1480 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1481 #: opensuse-tumbleweed
1482 msgid ""
1483 "Modify information about the system call that caused the stop. The I<data> "
1484 "argument is a pointer to I<struct ptrace_syscall_info> that specifies the "
1485 "system call information to be set. The I<addr> argument should be set to "
1486 "I<sizeof(struct ptrace_syscall_info)>. Only the I<nr>, I<args>, and I<rval> "
1487 "fields can be modified."
1488 msgstr ""
1489
1490 #. type: SS
1491 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1492 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1493 #, no-wrap
1494 msgid "Death under ptrace"
1495 msgstr ""
1496
1497 #. type: Plain text
1498 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1499 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1500 msgid ""
1501 "When a (possibly multithreaded) process receives a killing signal (one whose "
1502 "disposition is set to B<SIG_DFL> and whose default action is to kill the "
1503 "process), all threads exit. Tracees report their death to their tracer(s). "
1504 "Notification of this event is delivered via B<waitpid>(2)."
1505 msgstr ""
1506
1507 #. type: Plain text
1508 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1509 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1510 msgid ""
1511 "Note that the killing signal will first cause signal-delivery-stop (on one "
1512 "tracee only), and only after it is injected by the tracer (or after it was "
1513 "dispatched to a thread which isn't traced), will death from the signal "
1514 "happen on I<all> tracees within a multithreaded process. (The term \"signal-"
1515 "delivery-stop\" is explained below.)"
1516 msgstr ""
1517
1518 #. type: Plain text
1519 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1520 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1521 msgid ""
1522 "B<SIGKILL> does not generate signal-delivery-stop and therefore the tracer "
1523 "can't suppress it. B<SIGKILL> kills even within system calls (syscall-exit-"
1524 "stop is not generated prior to death by B<SIGKILL>). The net effect is that "
1525 "B<SIGKILL> always kills the process (all its threads), even if some threads "
1526 "of the process are ptraced."
1527 msgstr ""
1528
1529 #. type: Plain text
1530 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1531 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1532 msgid ""
1533 "When the tracee calls B<_exit>(2), it reports its death to its tracer. "
1534 "Other threads are not affected."
1535 msgstr ""
1536
1537 #. type: Plain text
1538 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1539 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1540 msgid ""
1541 "When any thread executes B<exit_group>(2), every tracee in its thread group "
1542 "reports its death to its tracer."
1543 msgstr ""
1544
1545 #. type: Plain text
1546 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1547 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1548 msgid ""
1549 "If the B<PTRACE_O_TRACEEXIT> option is on, B<PTRACE_EVENT_EXIT> will happen "
1550 "before actual death. This applies to exits via B<exit>(2), "
1551 "B<exit_group>(2), and signal deaths (except B<SIGKILL>, depending on the "
1552 "kernel version; see BUGS below), and when threads are torn down on "
1553 "B<execve>(2) in a multithreaded process."
1554 msgstr ""
1555
1556 #. type: Plain text
1557 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1558 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1559 msgid ""
1560 "The tracer cannot assume that the ptrace-stopped tracee exists. There are "
1561 "many scenarios when the tracee may die while stopped (such as B<SIGKILL>). "
1562 "Therefore, the tracer must be prepared to handle an B<ESRCH> error on any "
1563 "ptrace operation. Unfortunately, the same error is returned if the tracee "
1564 "exists but is not ptrace-stopped (for commands which require a stopped "
1565 "tracee), or if it is not traced by the process which issued the ptrace "
1566 "call. The tracer needs to keep track of the stopped/running state of the "
1567 "tracee, and interpret B<ESRCH> as \"tracee died unexpectedly\" only if it "
1568 "knows that the tracee has been observed to enter ptrace-stop. Note that "
1569 "there is no guarantee that I<waitpid(WNOHANG)> will reliably report the "
1570 "tracee's death status if a ptrace operation returned B<ESRCH>. "
1571 "I<waitpid(WNOHANG)> may return 0 instead. In other words, the tracee may be "
1572 "\"not yet fully dead\", but already refusing ptrace operations."
1573 msgstr ""
1574
1575 #. type: Plain text
1576 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1577 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1578 msgid ""
1579 "The tracer can't assume that the tracee I<always> ends its life by reporting "
1580 "I<WIFEXITED(status)> or I<WIFSIGNALED(status)>; there are cases where this "
1581 "does not occur. For example, if a thread other than thread group leader "
1582 "does an B<execve>(2), it disappears; its PID will never be seen again, and "
1583 "any subsequent ptrace stops will be reported under the thread group leader's "
1584 "PID."
1585 msgstr ""
1586
1587 #. type: SS
1588 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1589 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1590 #, no-wrap
1591 msgid "Stopped states"
1592 msgstr ""
1593
1594 #. type: Plain text
1595 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1596 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1597 msgid ""
1598 "A tracee can be in two states: running or stopped. For the purposes of "
1599 "ptrace, a tracee which is blocked in a system call (such as B<read>(2), "
1600 "B<pause>(2), etc.) is nevertheless considered to be running, even if the "
1601 "tracee is blocked for a long time. The state of the tracee after "
1602 "B<PTRACE_LISTEN> is somewhat of a gray area: it is not in any ptrace-stop "
1603 "(ptrace commands won't work on it, and it will deliver B<waitpid>(2) "
1604 "notifications), but it also may be considered \"stopped\" because it is not "
1605 "executing instructions (is not scheduled), and if it was in group-stop "
1606 "before B<PTRACE_LISTEN>, it will not respond to signals until B<SIGCONT> is "
1607 "received."
1608 msgstr ""
1609
1610 #. type: Plain text
1611 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1612 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1613 msgid ""
1614 "There are many kinds of states when the tracee is stopped, and in ptrace "
1615 "discussions they are often conflated. Therefore, it is important to use "
1616 "precise terms."
1617 msgstr ""
1618
1619 #. type: Plain text
1620 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1621 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1622 msgid ""
1623 "In this manual page, any stopped state in which the tracee is ready to "
1624 "accept ptrace commands from the tracer is called I<ptrace-stop>. Ptrace-"
1625 "stops can be further subdivided into I<signal-delivery-stop>, I<group-stop>, "
1626 "I<syscall-stop>, I<PTRACE_EVENT stops>, and so on. These stopped states are "
1627 "described in detail below."
1628 msgstr ""
1629
1630 #. type: Plain text
1631 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1632 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1633 msgid ""
1634 "When the running tracee enters ptrace-stop, it notifies its tracer using "
1635 "B<waitpid>(2) (or one of the other \"wait\" system calls). Most of this "
1636 "manual page assumes that the tracer waits with:"
1637 msgstr ""
1638
1639 #. type: Plain text
1640 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1641 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1642 #, no-wrap
1643 msgid "pid = waitpid(pid_or_minus_1, &status, __WALL);\n"
1644 msgstr ""
1645
1646 #. Denys Vlasenko:
1647 #. Do we require __WALL usage, or will just using 0 be ok? (With 0,
1648 #. I am not 100% sure there aren't ugly corner cases.) Are the
1649 #. rules different if user wants to use waitid? Will waitid require
1650 #. WEXITED?
1651 #. type: Plain text
1652 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1653 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1654 msgid ""
1655 "Ptrace-stopped tracees are reported as returns with I<pid> greater than 0 "
1656 "and I<WIFSTOPPED(status)> true."
1657 msgstr ""
1658
1659 #. type: Plain text
1660 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1661 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1662 msgid ""
1663 "The B<__WALL> flag does not include the B<WSTOPPED> and B<WEXITED> flags, "
1664 "but implies their functionality."
1665 msgstr ""
1666
1667 #. type: Plain text
1668 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1669 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1670 msgid ""
1671 "Setting the B<WCONTINUED> flag when calling B<waitpid>(2) is not "
1672 "recommended: the \"continued\" state is per-process and consuming it can "
1673 "confuse the real parent of the tracee."
1674 msgstr ""
1675
1676 #. type: Plain text
1677 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1678 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1679 msgid ""
1680 "Use of the B<WNOHANG> flag may cause B<waitpid>(2) to return 0 (\"no wait "
1681 "results available yet\") even if the tracer knows there should be a "
1682 "notification. Example:"
1683 msgstr ""
1684
1685 #. type: Plain text
1686 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1687 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1688 #, no-wrap
1689 msgid ""
1690 "errno = 0;\n"
1691 "ptrace(PTRACE_CONT, pid, 0L, 0L);\n"
1692 "if (errno == ESRCH) {\n"
1693 " /* tracee is dead */\n"
1694 " r = waitpid(tracee, &status, __WALL | WNOHANG);\n"
1695 " /* r can still be 0 here! */\n"
1696 "}\n"
1697 msgstr ""
1698
1699 #. type: Plain text
1700 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1701 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1702 msgid ""
1703 "The following kinds of ptrace-stops exist: signal-delivery-stops, group-"
1704 "stops, B<PTRACE_EVENT> stops, syscall-stops. They all are reported by "
1705 "B<waitpid>(2) with I<WIFSTOPPED(status)> true. They may be differentiated "
1706 "by examining the value I<statusE<gt>E<gt>8>, and if there is ambiguity in "
1707 "that value, by querying B<PTRACE_GETSIGINFO>. (Note: the "
1708 "I<WSTOPSIG(status)> macro can't be used to perform this examination, because "
1709 "it returns the value I<(statusE<gt>E<gt>8)\\ &\\ 0xff>.)"
1710 msgstr ""
1711
1712 #. type: SS
1713 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1714 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1715 #, no-wrap
1716 msgid "Signal-delivery-stop"
1717 msgstr ""
1718
1719 #. type: Plain text
1720 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1721 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1722 msgid ""
1723 "When a (possibly multithreaded) process receives any signal except "
1724 "B<SIGKILL>, the kernel selects an arbitrary thread which handles the "
1725 "signal. (If the signal is generated with B<tgkill>(2), the target thread "
1726 "can be explicitly selected by the caller.) If the selected thread is "
1727 "traced, it enters signal-delivery-stop. At this point, the signal is not "
1728 "yet delivered to the process, and can be suppressed by the tracer. If the "
1729 "tracer doesn't suppress the signal, it passes the signal to the tracee in "
1730 "the next ptrace restart operation. This second step of signal delivery is "
1731 "called I<signal injection> in this manual page. Note that if the signal is "
1732 "blocked, signal-delivery-stop doesn't happen until the signal is unblocked, "
1733 "with the usual exception that B<SIGSTOP> can't be blocked."
1734 msgstr ""
1735
1736 #. type: Plain text
1737 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1738 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1739 msgid ""
1740 "Signal-delivery-stop is observed by the tracer as B<waitpid>(2) returning "
1741 "with I<WIFSTOPPED(status)> true, with the signal returned by "
1742 "I<WSTOPSIG(status)>. If the signal is B<SIGTRAP>, this may be a different "
1743 "kind of ptrace-stop; see the \"Syscall-stops\" and \"execve\" sections below "
1744 "for details. If I<WSTOPSIG(status)> returns a stopping signal, this may be "
1745 "a group-stop; see below."
1746 msgstr ""
1747
1748 #. type: SS
1749 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1750 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1751 #, no-wrap
1752 msgid "Signal injection and suppression"
1753 msgstr ""
1754
1755 #. type: Plain text
1756 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1757 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1758 msgid ""
1759 "After signal-delivery-stop is observed by the tracer, the tracer should "
1760 "restart the tracee with the call"
1761 msgstr ""
1762
1763 #. type: Plain text
1764 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1765 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1766 #, no-wrap
1767 msgid "ptrace(PTRACE_restart, pid, 0, sig)\n"
1768 msgstr ""
1769
1770 #. type: Plain text
1771 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1772 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1773 msgid ""
1774 "where B<PTRACE_restart> is one of the restarting ptrace operations. If "
1775 "I<sig> is 0, then a signal is not delivered. Otherwise, the signal I<sig> "
1776 "is delivered. This operation is called I<signal injection> in this manual "
1777 "page, to distinguish it from signal-delivery-stop."
1778 msgstr ""
1779
1780 #. type: Plain text
1781 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1782 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1783 msgid ""
1784 "The I<sig> value may be different from the I<WSTOPSIG(status)> value: the "
1785 "tracer can cause a different signal to be injected."
1786 msgstr ""
1787
1788 #. type: Plain text
1789 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1790 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1791 msgid ""
1792 "Note that a suppressed signal still causes system calls to return "
1793 "prematurely. In this case, system calls will be restarted: the tracer will "
1794 "observe the tracee to reexecute the interrupted system call (or "
1795 "B<restart_syscall>(2) system call for a few system calls which use a "
1796 "different mechanism for restarting) if the tracer uses B<PTRACE_SYSCALL>. "
1797 "Even system calls (such as B<poll>(2)) which are not restartable after "
1798 "signal are restarted after signal is suppressed; however, kernel bugs exist "
1799 "which cause some system calls to fail with B<EINTR> even though no "
1800 "observable signal is injected to the tracee."
1801 msgstr ""
1802
1803 #. type: Plain text
1804 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1805 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1806 msgid ""
1807 "Restarting ptrace commands issued in ptrace-stops other than signal-delivery-"
1808 "stop are not guaranteed to inject a signal, even if I<sig> is nonzero. No "
1809 "error is reported; a nonzero I<sig> may simply be ignored. Ptrace users "
1810 "should not try to \"create a new signal\" this way: use B<tgkill>(2) "
1811 "instead."
1812 msgstr ""
1813
1814 #. type: Plain text
1815 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1816 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1817 msgid ""
1818 "The fact that signal injection operations may be ignored when restarting the "
1819 "tracee after ptrace stops that are not signal-delivery-stops is a cause of "
1820 "confusion among ptrace users. One typical scenario is that the tracer "
1821 "observes group-stop, mistakes it for signal-delivery-stop, restarts the "
1822 "tracee with"
1823 msgstr ""
1824
1825 #. type: Plain text
1826 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1827 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1828 #, no-wrap
1829 msgid "ptrace(PTRACE_restart, pid, 0, stopsig)\n"
1830 msgstr ""
1831
1832 #. type: Plain text
1833 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1834 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1835 msgid ""
1836 "with the intention of injecting I<stopsig>, but I<stopsig> gets ignored and "
1837 "the tracee continues to run."
1838 msgstr ""
1839
1840 #. type: Plain text
1841 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1842 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1843 msgid ""
1844 "The B<SIGCONT> signal has a side effect of waking up (all threads of) a "
1845 "group-stopped process. This side effect happens before signal-delivery-"
1846 "stop. The tracer can't suppress this side effect (it can only suppress "
1847 "signal injection, which only causes the B<SIGCONT> handler to not be "
1848 "executed in the tracee, if such a handler is installed). In fact, waking up "
1849 "from group-stop may be followed by signal-delivery-stop for signal(s) "
1850 "I<other than> B<SIGCONT>, if they were pending when B<SIGCONT> was "
1851 "delivered. In other words, B<SIGCONT> may be not the first signal observed "
1852 "by the tracee after it was sent."
1853 msgstr ""
1854
1855 #. type: Plain text
1856 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1857 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1858 msgid ""
1859 "Stopping signals cause (all threads of) a process to enter group-stop. This "
1860 "side effect happens after signal injection, and therefore can be suppressed "
1861 "by the tracer."
1862 msgstr ""
1863
1864 #
1865 #. In the Linux 2.4 sources, in arch/i386/kernel/signal.c::do_signal(),
1866 #. there is:
1867 #. /* The debugger continued. Ignore SIGSTOP. */
1868 #. if (signr == SIGSTOP)
1869 #. continue;
1870 #. type: Plain text
1871 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1872 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1873 msgid "In Linux 2.4 and earlier, the B<SIGSTOP> signal can't be injected."
1874 msgstr ""
1875
1876 #. type: Plain text
1877 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1878 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1879 msgid ""
1880 "B<PTRACE_GETSIGINFO> can be used to retrieve a I<siginfo_t> structure which "
1881 "corresponds to the delivered signal. B<PTRACE_SETSIGINFO> may be used to "
1882 "modify it. If B<PTRACE_SETSIGINFO> has been used to alter I<siginfo_t>, the "
1883 "I<si_signo> field and the I<sig> parameter in the restarting command must "
1884 "match, otherwise the result is undefined."
1885 msgstr ""
1886
1887 #. type: SS
1888 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1889 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1890 #, no-wrap
1891 msgid "Group-stop"
1892 msgstr ""
1893
1894 #. type: Plain text
1895 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1896 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1897 msgid ""
1898 "When a (possibly multithreaded) process receives a stopping signal, all "
1899 "threads stop. If some threads are traced, they enter a group-stop. Note "
1900 "that the stopping signal will first cause signal-delivery-stop (on one "
1901 "tracee only), and only after it is injected by the tracer (or after it was "
1902 "dispatched to a thread which isn't traced), will group-stop be initiated on "
1903 "I<all> tracees within the multithreaded process. As usual, every tracee "
1904 "reports its group-stop separately to the corresponding tracer."
1905 msgstr ""
1906
1907 #. type: Plain text
1908 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1909 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1910 msgid ""
1911 "Group-stop is observed by the tracer as B<waitpid>(2) returning with "
1912 "I<WIFSTOPPED(status)> true, with the stopping signal available via "
1913 "I<WSTOPSIG(status)>. The same result is returned by some other classes of "
1914 "ptrace-stops, therefore the recommended practice is to perform the call"
1915 msgstr ""
1916
1917 #. type: Plain text
1918 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1919 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1920 #, no-wrap
1921 msgid "ptrace(PTRACE_GETSIGINFO, pid, 0, &siginfo)\n"
1922 msgstr ""
1923
1924 #. type: Plain text
1925 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1926 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1927 msgid ""
1928 "The call can be avoided if the signal is not B<SIGSTOP>, B<SIGTSTP>, "
1929 "B<SIGTTIN>, or B<SIGTTOU>; only these four signals are stopping signals. If "
1930 "the tracer sees something else, it can't be a group-stop. Otherwise, the "
1931 "tracer needs to call B<PTRACE_GETSIGINFO>. If B<PTRACE_GETSIGINFO> fails "
1932 "with B<EINVAL>, then it is definitely a group-stop. (Other failure codes "
1933 "are possible, such as B<ESRCH> (\"no such process\") if a B<SIGKILL> killed "
1934 "the tracee.)"
1935 msgstr ""
1936
1937 #. type: Plain text
1938 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1939 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1940 msgid ""
1941 "If tracee was attached using B<PTRACE_SEIZE>, group-stop is indicated by "
1942 "B<PTRACE_EVENT_STOP>: I<statusE<gt>E<gt>16 == PTRACE_EVENT_STOP>. This "
1943 "allows detection of group-stops without requiring an extra "
1944 "B<PTRACE_GETSIGINFO> call."
1945 msgstr ""
1946
1947 #. type: Plain text
1948 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1949 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1950 msgid ""
1951 "As of Linux 2.6.38, after the tracer sees the tracee ptrace-stop and until "
1952 "it restarts or kills it, the tracee will not run, and will not send "
1953 "notifications (except B<SIGKILL> death) to the tracer, even if the tracer "
1954 "enters into another B<waitpid>(2) call."
1955 msgstr ""
1956
1957 #. type: Plain text
1958 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1959 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1960 msgid ""
1961 "The kernel behavior described in the previous paragraph causes a problem "
1962 "with transparent handling of stopping signals. If the tracer restarts the "
1963 "tracee after group-stop, the stopping signal is effectively ignored\\[em]the "
1964 "tracee doesn't remain stopped, it runs. If the tracer doesn't restart the "
1965 "tracee before entering into the next B<waitpid>(2), future B<SIGCONT> "
1966 "signals will not be reported to the tracer; this would cause the B<SIGCONT> "
1967 "signals to have no effect on the tracee."
1968 msgstr ""
1969
1970 #. type: Plain text
1971 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1972 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1973 msgid ""
1974 "Since Linux 3.4, there is a method to overcome this problem: instead of "
1975 "B<PTRACE_CONT>, a B<PTRACE_LISTEN> command can be used to restart a tracee "
1976 "in a way where it does not execute, but waits for a new event which it can "
1977 "report via B<waitpid>(2) (such as when it is restarted by a B<SIGCONT>)."
1978 msgstr ""
1979
1980 #. type: SS
1981 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1982 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1983 #, no-wrap
1984 msgid "PTRACE_EVENT stops"
1985 msgstr ""
1986
1987 #. type: Plain text
1988 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1989 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1990 msgid ""
1991 "If the tracer sets B<PTRACE_O_TRACE_*> options, the tracee will enter ptrace-"
1992 "stops called B<PTRACE_EVENT> stops."
1993 msgstr ""
1994
1995 #. type: Plain text
1996 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1997 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1998 msgid ""
1999 "B<PTRACE_EVENT> stops are observed by the tracer as B<waitpid>(2) returning "
2000 "with I<WIFSTOPPED(status)>, and I<WSTOPSIG(status)> returns B<SIGTRAP> (or "
2001 "for B<PTRACE_EVENT_STOP>, returns the stopping signal if tracee is in a "
2002 "group-stop). An additional bit is set in the higher byte of the status "
2003 "word: the value I<statusE<gt>E<gt>8> will be"
2004 msgstr ""
2005
2006 #. type: Plain text
2007 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2008 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2009 #, no-wrap
2010 msgid "((PTRACE_EVENT_fooE<lt>E<lt>8) | SIGTRAP).\n"
2011 msgstr ""
2012
2013 #. type: Plain text
2014 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2015 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2016 msgid "The following events exist:"
2017 msgstr ""
2018
2019 #. type: TP
2020 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2021 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2022 #, no-wrap
2023 msgid "B<PTRACE_EVENT_VFORK>"
2024 msgstr ""
2025
2026 #. type: Plain text
2027 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2028 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2029 msgid ""
2030 "Stop before return from B<vfork>(2) or B<clone>(2) with the B<CLONE_VFORK> "
2031 "flag. When the tracee is continued after this stop, it will wait for child "
2032 "to exit/exec before continuing its execution (in other words, the usual "
2033 "behavior on B<vfork>(2))."
2034 msgstr ""
2035
2036 #. type: TP
2037 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2038 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2039 #, no-wrap
2040 msgid "B<PTRACE_EVENT_FORK>"
2041 msgstr ""
2042
2043 #. type: Plain text
2044 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2045 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2046 msgid ""
2047 "Stop before return from B<fork>(2) or B<clone>(2) with the exit signal set "
2048 "to B<SIGCHLD>."
2049 msgstr ""
2050
2051 #. type: TP
2052 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2053 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2054 #, no-wrap
2055 msgid "B<PTRACE_EVENT_CLONE>"
2056 msgstr ""
2057
2058 #. type: Plain text
2059 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2060 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2061 msgid "Stop before return from B<clone>(2)."
2062 msgstr ""
2063
2064 #. type: TP
2065 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2066 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2067 #, no-wrap
2068 msgid "B<PTRACE_EVENT_VFORK_DONE>"
2069 msgstr ""
2070
2071 #. type: Plain text
2072 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2073 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2074 msgid ""
2075 "Stop before return from B<vfork>(2) or B<clone>(2) with the B<CLONE_VFORK> "
2076 "flag, but after the child unblocked this tracee by exiting or execing."
2077 msgstr ""
2078
2079 #. type: Plain text
2080 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2081 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2082 msgid ""
2083 "For all four stops described above, the stop occurs in the parent (i.e., the "
2084 "tracee), not in the newly created thread. B<PTRACE_GETEVENTMSG> can be used "
2085 "to retrieve the new thread's ID."
2086 msgstr ""
2087
2088 #. type: TP
2089 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2090 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2091 #, no-wrap
2092 msgid "B<PTRACE_EVENT_EXEC>"
2093 msgstr ""
2094
2095 #. type: Plain text
2096 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2097 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2098 msgid ""
2099 "Stop before return from B<execve>(2). Since Linux 3.0, "
2100 "B<PTRACE_GETEVENTMSG> returns the former thread ID."
2101 msgstr ""
2102
2103 #. type: TP
2104 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2105 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2106 #, no-wrap
2107 msgid "B<PTRACE_EVENT_EXIT>"
2108 msgstr ""
2109
2110 #. type: Plain text
2111 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2112 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2113 msgid ""
2114 "Stop before exit (including death from B<exit_group>(2)), signal death, or "
2115 "exit caused by B<execve>(2) in a multithreaded process. "
2116 "B<PTRACE_GETEVENTMSG> returns the exit status. Registers can be examined "
2117 "(unlike when \"real\" exit happens). The tracee is still alive; it needs to "
2118 "be B<PTRACE_CONT>ed or B<PTRACE_DETACH>ed to finish exiting."
2119 msgstr ""
2120
2121 #. type: TP
2122 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2123 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2124 #, no-wrap
2125 msgid "B<PTRACE_EVENT_STOP>"
2126 msgstr ""
2127
2128 #. type: Plain text
2129 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2130 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2131 msgid ""
2132 "Stop induced by B<PTRACE_INTERRUPT> command, or group-stop, or initial "
2133 "ptrace-stop when a new child is attached (only if attached using "
2134 "B<PTRACE_SEIZE>)."
2135 msgstr ""
2136
2137 #. type: TP
2138 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2139 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2140 #, no-wrap
2141 msgid "B<PTRACE_EVENT_SECCOMP>"
2142 msgstr ""
2143
2144 #. type: Plain text
2145 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2146 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2147 msgid ""
2148 "Stop triggered by a B<seccomp>(2) rule on tracee syscall entry when "
2149 "B<PTRACE_O_TRACESECCOMP> has been set by the tracer. The seccomp event "
2150 "message data (from the B<SECCOMP_RET_DATA> portion of the seccomp filter "
2151 "rule) can be retrieved with B<PTRACE_GETEVENTMSG>. The semantics of this "
2152 "stop are described in detail in a separate section below."
2153 msgstr ""
2154
2155 #. type: Plain text
2156 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2157 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2158 msgid ""
2159 "B<PTRACE_GETSIGINFO> on B<PTRACE_EVENT> stops returns B<SIGTRAP> in "
2160 "I<si_signo>, with I<si_code> set to I<(eventE<lt>E<lt>8)\\ |\\ SIGTRAP>."
2161 msgstr ""
2162
2163 #. type: SS
2164 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2165 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2166 #, no-wrap
2167 msgid "Syscall-stops"
2168 msgstr ""
2169
2170 #. type: Plain text
2171 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2172 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2173 msgid ""
2174 "If the tracee was restarted by B<PTRACE_SYSCALL> or B<PTRACE_SYSEMU>, the "
2175 "tracee enters syscall-enter-stop just prior to entering any system call "
2176 "(which will not be executed if the restart was using B<PTRACE_SYSEMU>, "
2177 "regardless of any change made to registers at this point or how the tracee "
2178 "is restarted after this stop). No matter which method caused the syscall-"
2179 "entry-stop, if the tracer restarts the tracee with B<PTRACE_SYSCALL>, the "
2180 "tracee enters syscall-exit-stop when the system call is finished, or if it "
2181 "is interrupted by a signal. (That is, signal-delivery-stop never happens "
2182 "between syscall-enter-stop and syscall-exit-stop; it happens I<after> "
2183 "syscall-exit-stop.). If the tracee is continued using any other method "
2184 "(including B<PTRACE_SYSEMU>), no syscall-exit-stop occurs. Note that all "
2185 "mentions B<PTRACE_SYSEMU> apply equally to B<PTRACE_SYSEMU_SINGLESTEP>."
2186 msgstr ""
2187
2188 #. type: Plain text
2189 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2190 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2191 msgid ""
2192 "However, even if the tracee was continued using B<PTRACE_SYSCALL>, it is not "
2193 "guaranteed that the next stop will be a syscall-exit-stop. Other "
2194 "possibilities are that the tracee may stop in a B<PTRACE_EVENT> stop "
2195 "(including seccomp stops), exit (if it entered B<_exit>(2) or "
2196 "B<exit_group>(2)), be killed by B<SIGKILL>, or die silently (if it is a "
2197 "thread group leader, the B<execve>(2) happened in another thread, and that "
2198 "thread is not traced by the same tracer; this situation is discussed later)."
2199 msgstr ""
2200
2201 #. type: Plain text
2202 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2203 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2204 msgid ""
2205 "Syscall-enter-stop and syscall-exit-stop are observed by the tracer as "
2206 "B<waitpid>(2) returning with I<WIFSTOPPED(status)> true, and "
2207 "I<WSTOPSIG(status)> giving B<SIGTRAP>. If the B<PTRACE_O_TRACESYSGOOD> "
2208 "option was set by the tracer, then I<WSTOPSIG(status)> will give the value "
2209 "I<(SIGTRAP\\ |\\ 0x80)>."
2210 msgstr ""
2211
2212 #. type: Plain text
2213 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2214 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2215 msgid ""
2216 "Syscall-stops can be distinguished from signal-delivery-stop with B<SIGTRAP> "
2217 "by querying B<PTRACE_GETSIGINFO> for the following cases:"
2218 msgstr ""
2219
2220 #. type: TP
2221 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2222 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2223 #, no-wrap
2224 msgid "I<si_code> E<lt>= 0"
2225 msgstr ""
2226
2227 #. type: Plain text
2228 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2229 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2230 msgid ""
2231 "B<SIGTRAP> was delivered as a result of a user-space action, for example, a "
2232 "system call (B<tgkill>(2), B<kill>(2), B<sigqueue>(3), etc.), expiration of "
2233 "a POSIX timer, change of state on a POSIX message queue, or completion of an "
2234 "asynchronous I/O operation."
2235 msgstr ""
2236
2237 #. type: TP
2238 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2239 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2240 #, no-wrap
2241 msgid "I<si_code> == SI_KERNEL (0x80)"
2242 msgstr ""
2243
2244 #. type: Plain text
2245 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2246 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2247 msgid "B<SIGTRAP> was sent by the kernel."
2248 msgstr ""
2249
2250 #. type: TP
2251 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2252 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2253 #, no-wrap
2254 msgid "I<si_code> == SIGTRAP or I<si_code> == (SIGTRAP|0x80)"
2255 msgstr ""
2256
2257 #. type: Plain text
2258 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2259 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2260 msgid "This is a syscall-stop."
2261 msgstr ""
2262
2263 #. type: Plain text
2264 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2265 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2266 msgid ""
2267 "However, syscall-stops happen very often (twice per system call), and "
2268 "performing B<PTRACE_GETSIGINFO> for every syscall-stop may be somewhat "
2269 "expensive."
2270 msgstr ""
2271
2272 #. type: Plain text
2273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2275 msgid ""
2276 "Some architectures allow the cases to be distinguished by examining "
2277 "registers. For example, on x86, I<rax> == -B<ENOSYS> in syscall-enter-"
2278 "stop. Since B<SIGTRAP> (like any other signal) always happens I<after> "
2279 "syscall-exit-stop, and at this point I<rax> almost never contains "
2280 "-B<ENOSYS>, the B<SIGTRAP> looks like \"syscall-stop which is not syscall-"
2281 "enter-stop\"; in other words, it looks like a \"stray syscall-exit-stop\" "
2282 "and can be detected this way. But such detection is fragile and is best "
2283 "avoided."
2284 msgstr ""
2285
2286 #. type: Plain text
2287 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2288 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2289 msgid ""
2290 "Using the B<PTRACE_O_TRACESYSGOOD> option is the recommended method to "
2291 "distinguish syscall-stops from other kinds of ptrace-stops, since it is "
2292 "reliable and does not incur a performance penalty."
2293 msgstr ""
2294
2295 #. type: Plain text
2296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2298 msgid ""
2299 "Syscall-enter-stop and syscall-exit-stop are indistinguishable from each "
2300 "other by the tracer. The tracer needs to keep track of the sequence of "
2301 "ptrace-stops in order to not misinterpret syscall-enter-stop as syscall-exit-"
2302 "stop or vice versa. In general, a syscall-enter-stop is always followed by "
2303 "syscall-exit-stop, B<PTRACE_EVENT> stop, or the tracee's death; no other "
2304 "kinds of ptrace-stop can occur in between. However, note that seccomp stops "
2305 "(see below) can cause syscall-exit-stops, without preceding syscall-entry-"
2306 "stops. If seccomp is in use, care needs to be taken not to misinterpret "
2307 "such stops as syscall-entry-stops."
2308 msgstr ""
2309
2310 #. type: Plain text
2311 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2312 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2313 msgid ""
2314 "If after syscall-enter-stop, the tracer uses a restarting command other than "
2315 "B<PTRACE_SYSCALL>, syscall-exit-stop is not generated."
2316 msgstr ""
2317
2318 #. type: Plain text
2319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2321 msgid ""
2322 "B<PTRACE_GETSIGINFO> on syscall-stops returns B<SIGTRAP> in I<si_signo>, "
2323 "with I<si_code> set to B<SIGTRAP> or I<(SIGTRAP|0x80)>."
2324 msgstr ""
2325
2326 #. type: SS
2327 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2328 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2329 #, no-wrap
2330 msgid "PTRACE_EVENT_SECCOMP stops (Linux 3.5 to Linux 4.7)"
2331 msgstr ""
2332
2333 #. type: Plain text
2334 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2335 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2336 msgid ""
2337 "The behavior of B<PTRACE_EVENT_SECCOMP> stops and their interaction with "
2338 "other kinds of ptrace stops has changed between kernel versions. This "
2339 "documents the behavior from their introduction until Linux 4.7 (inclusive). "
2340 "The behavior in later kernel versions is documented in the next section."
2341 msgstr ""
2342
2343 #. type: Plain text
2344 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2345 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2346 msgid ""
2347 "A B<PTRACE_EVENT_SECCOMP> stop occurs whenever a B<SECCOMP_RET_TRACE> rule "
2348 "is triggered. This is independent of which methods was used to restart the "
2349 "system call. Notably, seccomp still runs even if the tracee was restarted "
2350 "using B<PTRACE_SYSEMU> and this system call is unconditionally skipped."
2351 msgstr ""
2352
2353 #. type: Plain text
2354 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2355 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2356 msgid ""
2357 "Restarts from this stop will behave as if the stop had occurred right before "
2358 "the system call in question. In particular, both B<PTRACE_SYSCALL> and "
2359 "B<PTRACE_SYSEMU> will normally cause a subsequent syscall-entry-stop. "
2360 "However, if after the B<PTRACE_EVENT_SECCOMP> the system call number is "
2361 "negative, both the syscall-entry-stop and the system call itself will be "
2362 "skipped. This means that if the system call number is negative after a "
2363 "B<PTRACE_EVENT_SECCOMP> and the tracee is restarted using B<PTRACE_SYSCALL>, "
2364 "the next observed stop will be a syscall-exit-stop, rather than the syscall-"
2365 "entry-stop that might have been expected."
2366 msgstr ""
2367
2368 #. type: SS
2369 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2370 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2371 #, no-wrap
2372 msgid "PTRACE_EVENT_SECCOMP stops (since Linux 4.8)"
2373 msgstr ""
2374
2375 #. commit 93e35efb8de45393cf61ed07f7b407629bf698ea
2376 #. type: Plain text
2377 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2378 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2379 msgid ""
2380 "Starting with Linux 4.8, the B<PTRACE_EVENT_SECCOMP> stop was reordered to "
2381 "occur between syscall-entry-stop and syscall-exit-stop. Note that seccomp "
2382 "no longer runs (and no B<PTRACE_EVENT_SECCOMP> will be reported) if the "
2383 "system call is skipped due to B<PTRACE_SYSEMU>."
2384 msgstr ""
2385
2386 #. type: Plain text
2387 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2388 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2389 msgid ""
2390 "Functionally, a B<PTRACE_EVENT_SECCOMP> stop functions comparably to a "
2391 "syscall-entry-stop (i.e., continuations using B<PTRACE_SYSCALL> will cause "
2392 "syscall-exit-stops, the system call number may be changed and any other "
2393 "modified registers are visible to the to-be-executed system call as well). "
2394 "Note that there may be, but need not have been a preceding syscall-entry-"
2395 "stop."
2396 msgstr ""
2397
2398 #. type: Plain text
2399 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2400 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2401 msgid ""
2402 "After a B<PTRACE_EVENT_SECCOMP> stop, seccomp will be rerun, with a "
2403 "B<SECCOMP_RET_TRACE> rule now functioning the same as a "
2404 "B<SECCOMP_RET_ALLOW>. Specifically, this means that if registers are not "
2405 "modified during the B<PTRACE_EVENT_SECCOMP> stop, the system call will then "
2406 "be allowed."
2407 msgstr ""
2408
2409 #. type: SS
2410 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2411 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2412 #, no-wrap
2413 msgid "PTRACE_SINGLESTEP stops"
2414 msgstr ""
2415
2416 #
2417 #. FIXME .
2418 #. document stops occurring with PTRACE_SINGLESTEP
2419 #. type: Plain text
2420 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2421 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2422 msgid "[Details of these kinds of stops are yet to be documented.]"
2423 msgstr ""
2424
2425 #. type: SS
2426 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2427 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2428 #, no-wrap
2429 msgid "Informational and restarting ptrace commands"
2430 msgstr ""
2431
2432 #. type: Plain text
2433 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2434 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2435 msgid ""
2436 "Most ptrace commands (all except B<PTRACE_ATTACH>, B<PTRACE_SEIZE>, "
2437 "B<PTRACE_TRACEME>, B<PTRACE_INTERRUPT>, and B<PTRACE_KILL>) require the "
2438 "tracee to be in a ptrace-stop, otherwise they fail with B<ESRCH>."
2439 msgstr ""
2440
2441 #. type: Plain text
2442 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2443 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2444 msgid ""
2445 "When the tracee is in ptrace-stop, the tracer can read and write data to the "
2446 "tracee using informational commands. These commands leave the tracee in "
2447 "ptrace-stopped state:"
2448 msgstr ""
2449
2450 #. type: Plain text
2451 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2452 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2453 #, no-wrap
2454 msgid ""
2455 "ptrace(PTRACE_PEEKTEXT/PEEKDATA/PEEKUSER, pid, addr, 0);\n"
2456 "ptrace(PTRACE_POKETEXT/POKEDATA/POKEUSER, pid, addr, long_val);\n"
2457 "ptrace(PTRACE_GETREGS/GETFPREGS, pid, 0, &struct);\n"
2458 "ptrace(PTRACE_SETREGS/SETFPREGS, pid, 0, &struct);\n"
2459 "ptrace(PTRACE_GETREGSET, pid, NT_foo, &iov);\n"
2460 "ptrace(PTRACE_SETREGSET, pid, NT_foo, &iov);\n"
2461 "ptrace(PTRACE_GETSIGINFO, pid, 0, &siginfo);\n"
2462 "ptrace(PTRACE_SETSIGINFO, pid, 0, &siginfo);\n"
2463 "ptrace(PTRACE_GETEVENTMSG, pid, 0, &long_var);\n"
2464 "ptrace(PTRACE_SETOPTIONS, pid, 0, PTRACE_O_flags);\n"
2465 msgstr ""
2466
2467 #. type: Plain text
2468 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2469 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2470 msgid ""
2471 "Note that some errors are not reported. For example, setting signal "
2472 "information (I<siginfo>) may have no effect in some ptrace-stops, yet the "
2473 "call may succeed (return 0 and not set I<errno>); querying "
2474 "B<PTRACE_GETEVENTMSG> may succeed and return some random value if current "
2475 "ptrace-stop is not documented as returning a meaningful event message."
2476 msgstr ""
2477
2478 #. type: Plain text
2479 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2480 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2481 msgid "The call"
2482 msgstr ""
2483
2484 #. type: Plain text
2485 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2486 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2487 #, no-wrap
2488 msgid "ptrace(PTRACE_SETOPTIONS, pid, 0, PTRACE_O_flags);\n"
2489 msgstr ""
2490
2491 #. type: Plain text
2492 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2493 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2494 msgid ""
2495 "affects one tracee. The tracee's current flags are replaced. Flags are "
2496 "inherited by new tracees created and \"auto-attached\" via active "
2497 "B<PTRACE_O_TRACEFORK>, B<PTRACE_O_TRACEVFORK>, or B<PTRACE_O_TRACECLONE> "
2498 "options."
2499 msgstr ""
2500
2501 #. type: Plain text
2502 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2503 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2504 msgid ""
2505 "Another group of commands makes the ptrace-stopped tracee run. They have "
2506 "the form:"
2507 msgstr ""
2508
2509 #. type: Plain text
2510 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2511 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2512 #, no-wrap
2513 msgid "ptrace(cmd, pid, 0, sig);\n"
2514 msgstr ""
2515
2516 #. type: Plain text
2517 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2518 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2519 msgid ""
2520 "where I<cmd> is B<PTRACE_CONT>, B<PTRACE_LISTEN>, B<PTRACE_DETACH>, "
2521 "B<PTRACE_SYSCALL>, B<PTRACE_SINGLESTEP>, B<PTRACE_SYSEMU>, or "
2522 "B<PTRACE_SYSEMU_SINGLESTEP>. If the tracee is in signal-delivery-stop, "
2523 "I<sig> is the signal to be injected (if it is nonzero). Otherwise, I<sig> "
2524 "may be ignored. (When restarting a tracee from a ptrace-stop other than "
2525 "signal-delivery-stop, recommended practice is to always pass 0 in I<sig>.)"
2526 msgstr ""
2527
2528 #. type: SS
2529 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2530 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2531 #, no-wrap
2532 msgid "Attaching and detaching"
2533 msgstr ""
2534
2535 #. type: Plain text
2536 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2537 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2538 msgid "A thread can be attached to the tracer using the call"
2539 msgstr ""
2540
2541 #. type: Plain text
2542 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2543 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2544 #, no-wrap
2545 msgid "ptrace(PTRACE_ATTACH, pid, 0, 0);\n"
2546 msgstr ""
2547
2548 #. type: Plain text
2549 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2550 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2551 msgid "or"
2552 msgstr ""
2553
2554 #. type: Plain text
2555 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2556 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2557 #, no-wrap
2558 msgid "ptrace(PTRACE_SEIZE, pid, 0, PTRACE_O_flags);\n"
2559 msgstr ""
2560
2561 #
2562 #. FIXME Describe how to attach to a thread which is already group-stopped.
2563 #. type: Plain text
2564 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2565 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2566 msgid ""
2567 "B<PTRACE_ATTACH> sends B<SIGSTOP> to this thread. If the tracer wants this "
2568 "B<SIGSTOP> to have no effect, it needs to suppress it. Note that if other "
2569 "signals are concurrently sent to this thread during attach, the tracer may "
2570 "see the tracee enter signal-delivery-stop with other signal(s) first! The "
2571 "usual practice is to reinject these signals until B<SIGSTOP> is seen, then "
2572 "suppress B<SIGSTOP> injection. The design bug here is that a ptrace attach "
2573 "and a concurrently delivered B<SIGSTOP> may race and the concurrent "
2574 "B<SIGSTOP> may be lost."
2575 msgstr ""
2576
2577 #. type: Plain text
2578 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2579 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2580 msgid ""
2581 "Since attaching sends B<SIGSTOP> and the tracer usually suppresses it, this "
2582 "may cause a stray B<EINTR> return from the currently executing system call "
2583 "in the tracee, as described in the \"Signal injection and suppression\" "
2584 "section."
2585 msgstr ""
2586
2587 #. type: Plain text
2588 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2589 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2590 msgid ""
2591 "Since Linux 3.4, B<PTRACE_SEIZE> can be used instead of B<PTRACE_ATTACH>. "
2592 "B<PTRACE_SEIZE> does not stop the attached process. If you need to stop it "
2593 "after attach (or at any other time) without sending it any signals, use "
2594 "B<PTRACE_INTERRUPT> command."
2595 msgstr ""
2596
2597 #. type: Plain text
2598 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2599 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2600 msgid "The operation"
2601 msgstr ""
2602
2603 #. type: Plain text
2604 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2605 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2606 #, no-wrap
2607 msgid "ptrace(PTRACE_TRACEME, 0, 0, 0);\n"
2608 msgstr ""
2609
2610 #. type: Plain text
2611 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2612 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2613 msgid ""
2614 "turns the calling thread into a tracee. The thread continues to run "
2615 "(doesn't enter ptrace-stop). A common practice is to follow the "
2616 "B<PTRACE_TRACEME> with"
2617 msgstr ""
2618
2619 #. type: Plain text
2620 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2621 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2622 #, no-wrap
2623 msgid "raise(SIGSTOP);\n"
2624 msgstr ""
2625
2626 #. type: Plain text
2627 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2628 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2629 msgid ""
2630 "and allow the parent (which is our tracer now) to observe our signal-"
2631 "delivery-stop."
2632 msgstr ""
2633
2634 #. type: Plain text
2635 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2636 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2637 msgid ""
2638 "If the B<PTRACE_O_TRACEFORK>, B<PTRACE_O_TRACEVFORK>, or "
2639 "B<PTRACE_O_TRACECLONE> options are in effect, then children created by, "
2640 "respectively, B<vfork>(2) or B<clone>(2) with the B<CLONE_VFORK> flag, "
2641 "B<fork>(2) or B<clone>(2) with the exit signal set to B<SIGCHLD>, and "
2642 "other kinds of B<clone>(2), are automatically attached to the same tracer "
2643 "which traced their parent. B<SIGSTOP> is delivered to the children, causing "
2644 "them to enter signal-delivery-stop after they exit the system call which "
2645 "created them."
2646 msgstr ""
2647
2648 #. type: Plain text
2649 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2650 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2651 msgid "Detaching of the tracee is performed by:"
2652 msgstr ""
2653
2654 #. type: Plain text
2655 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2656 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2657 #, no-wrap
2658 msgid "ptrace(PTRACE_DETACH, pid, 0, sig);\n"
2659 msgstr ""
2660
2661 #. type: Plain text
2662 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2663 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2664 msgid ""
2665 "B<PTRACE_DETACH> is a restarting operation; therefore it requires the tracee "
2666 "to be in ptrace-stop. If the tracee is in signal-delivery-stop, a signal "
2667 "can be injected. Otherwise, the I<sig> parameter may be silently ignored."
2668 msgstr ""
2669
2670 #. FIXME Describe how to detach from a group-stopped tracee so that it
2671 #. doesn't run, but continues to wait for SIGCONT.
2672 #. type: Plain text
2673 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2674 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2675 msgid ""
2676 "If the tracee is running when the tracer wants to detach it, the usual "
2677 "solution is to send B<SIGSTOP> (using B<tgkill>(2), to make sure it goes to "
2678 "the correct thread), wait for the tracee to stop in signal-delivery-stop for "
2679 "B<SIGSTOP> and then detach it (suppressing B<SIGSTOP> injection). A design "
2680 "bug is that this can race with concurrent B<SIGSTOP>s. Another complication "
2681 "is that the tracee may enter other ptrace-stops and needs to be restarted "
2682 "and waited for again, until B<SIGSTOP> is seen. Yet another complication is "
2683 "to be sure that the tracee is not already ptrace-stopped, because no signal "
2684 "delivery happens while it is\\[em]not even B<SIGSTOP>."
2685 msgstr ""
2686
2687 #. type: Plain text
2688 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2689 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2690 msgid ""
2691 "If the tracer dies, all tracees are automatically detached and restarted, "
2692 "unless they were in group-stop. Handling of restart from group-stop is "
2693 "currently buggy, but the \"as planned\" behavior is to leave tracee stopped "
2694 "and waiting for B<SIGCONT>. If the tracee is restarted from signal-delivery-"
2695 "stop, the pending signal is injected."
2696 msgstr ""
2697
2698 #. type: SS
2699 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2700 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2701 #, no-wrap
2702 msgid "execve(2) under ptrace"
2703 msgstr ""
2704
2705 #
2706 #. clone(2) CLONE_THREAD says:
2707 #. If any of the threads in a thread group performs an execve(2),
2708 #. then all threads other than the thread group leader are terminated,
2709 #. and the new program is executed in the thread group leader.
2710 #. In Linux 3.1 sources, see fs/exec.c::de_thread()
2711 #. type: Plain text
2712 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2713 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2714 msgid ""
2715 "When one thread in a multithreaded process calls B<execve>(2), the kernel "
2716 "destroys all other threads in the process, and resets the thread ID of the "
2717 "execing thread to the thread group ID (process ID). (Or, to put things "
2718 "another way, when a multithreaded process does an B<execve>(2), at "
2719 "completion of the call, it appears as though the B<execve>(2) occurred in "
2720 "the thread group leader, regardless of which thread did the B<execve>(2).) "
2721 "This resetting of the thread ID looks very confusing to tracers:"
2722 msgstr ""
2723
2724 #. type: IP
2725 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2726 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2727 #, no-wrap
2728 msgid "\\[bu]"
2729 msgstr ""
2730
2731 #. type: Plain text
2732 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2733 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2734 msgid ""
2735 "All other threads stop in B<PTRACE_EVENT_EXIT> stop, if the "
2736 "B<PTRACE_O_TRACEEXIT> option was turned on. Then all other threads except "
2737 "the thread group leader report death as if they exited via B<_exit>(2) with "
2738 "exit code 0."
2739 msgstr ""
2740
2741 #. type: Plain text
2742 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2743 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2744 msgid ""
2745 "The execing tracee changes its thread ID while it is in the B<execve>(2). "
2746 "(Remember, under ptrace, the \"pid\" returned from B<waitpid>(2), or fed "
2747 "into ptrace calls, is the tracee's thread ID.) That is, the tracee's thread "
2748 "ID is reset to be the same as its process ID, which is the same as the "
2749 "thread group leader's thread ID."
2750 msgstr ""
2751
2752 #. type: Plain text
2753 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2754 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2755 msgid ""
2756 "Then a B<PTRACE_EVENT_EXEC> stop happens, if the B<PTRACE_O_TRACEEXEC> "
2757 "option was turned on."
2758 msgstr ""
2759
2760 #. type: Plain text
2761 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2762 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2763 msgid ""
2764 "If the thread group leader has reported its B<PTRACE_EVENT_EXIT> stop by "
2765 "this time, it appears to the tracer that the dead thread leader \"reappears "
2766 "from nowhere\". (Note: the thread group leader does not report death via "
2767 "I<WIFEXITED(status)> until there is at least one other live thread. This "
2768 "eliminates the possibility that the tracer will see it dying and then "
2769 "reappearing.) If the thread group leader was still alive, for the tracer "
2770 "this may look as if thread group leader returns from a different system call "
2771 "than it entered, or even \"returned from a system call even though it was "
2772 "not in any system call\". If the thread group leader was not traced (or was "
2773 "traced by a different tracer), then during B<execve>(2) it will appear as "
2774 "if it has become a tracee of the tracer of the execing tracee."
2775 msgstr ""
2776
2777 #. type: Plain text
2778 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2779 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2780 msgid ""
2781 "All of the above effects are the artifacts of the thread ID change in the "
2782 "tracee."
2783 msgstr ""
2784
2785 #. type: Plain text
2786 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2787 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2788 msgid ""
2789 "The B<PTRACE_O_TRACEEXEC> option is the recommended tool for dealing with "
2790 "this situation. First, it enables B<PTRACE_EVENT_EXEC> stop, which occurs "
2791 "before B<execve>(2) returns. In this stop, the tracer can use "
2792 "B<PTRACE_GETEVENTMSG> to retrieve the tracee's former thread ID. (This "
2793 "feature was introduced in Linux 3.0.) Second, the B<PTRACE_O_TRACEEXEC> "
2794 "option disables legacy B<SIGTRAP> generation on B<execve>(2)."
2795 msgstr ""
2796
2797 #. type: Plain text
2798 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2799 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2800 msgid ""
2801 "When the tracer receives B<PTRACE_EVENT_EXEC> stop notification, it is "
2802 "guaranteed that except this tracee and the thread group leader, no other "
2803 "threads from the process are alive."
2804 msgstr ""
2805
2806 #. type: Plain text
2807 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2808 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2809 msgid ""
2810 "On receiving the B<PTRACE_EVENT_EXEC> stop notification, the tracer should "
2811 "clean up all its internal data structures describing the threads of this "
2812 "process, and retain only one data structure\\[em]one which describes the "
2813 "single still running tracee, with"
2814 msgstr ""
2815
2816 #. type: Plain text
2817 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2818 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2819 #, no-wrap
2820 msgid "thread ID == thread group ID == process ID.\n"
2821 msgstr ""
2822
2823 #. type: Plain text
2824 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2825 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2826 msgid "Example: two threads call B<execve>(2) at the same time:"
2827 msgstr ""
2828
2829 #. type: Plain text
2830 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2831 #: opensuse-tumbleweed
2832 #, no-wrap
2833 msgid ""
2834 "*** we get syscall-enter-stop in thread 1: **\n"
2835 "PID1 execve(\"/bin/foo\", \"foo\" E<lt>unfinished ...E<gt>\n"
2836 "*** we issue PTRACE_SYSCALL for thread 1 **\n"
2837 "*** we get syscall-enter-stop in thread 2: **\n"
2838 "PID2 execve(\"/bin/bar\", \"bar\" E<lt>unfinished ...E<gt>\n"
2839 "*** we issue PTRACE_SYSCALL for thread 2 **\n"
2840 "*** we get PTRACE_EVENT_EXEC for PID0, we issue PTRACE_SYSCALL **\n"
2841 "*** we get syscall-exit-stop for PID0: **\n"
2842 "PID0 E<lt>...\\& execve resumedE<gt> ) = 0\n"
2843 msgstr ""
2844
2845 #. type: Plain text
2846 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2847 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2848 msgid ""
2849 "If the B<PTRACE_O_TRACEEXEC> option is I<not> in effect for the execing "
2850 "tracee, and if the tracee was B<PTRACE_ATTACH>ed rather that "
2851 "B<PTRACE_SEIZE>d, the kernel delivers an extra B<SIGTRAP> to the tracee "
2852 "after B<execve>(2) returns. This is an ordinary signal (similar to one "
2853 "which can be generated by I<kill -TRAP>), not a special kind of ptrace-"
2854 "stop. Employing B<PTRACE_GETSIGINFO> for this signal returns I<si_code> set "
2855 "to 0 (I<SI_USER>). This signal may be blocked by signal mask, and thus may "
2856 "be delivered (much) later."
2857 msgstr ""
2858
2859 #. type: Plain text
2860 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2861 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2862 msgid ""
2863 "Usually, the tracer (for example, B<strace>(1)) would not want to show this "
2864 "extra post-execve B<SIGTRAP> signal to the user, and would suppress its "
2865 "delivery to the tracee (if B<SIGTRAP> is set to B<SIG_DFL>, it is a killing "
2866 "signal). However, determining I<which> B<SIGTRAP> to suppress is not easy. "
2867 "Setting the B<PTRACE_O_TRACEEXEC> option or using B<PTRACE_SEIZE> and thus "
2868 "suppressing this extra B<SIGTRAP> is the recommended approach."
2869 msgstr ""
2870
2871 #. type: SS
2872 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2873 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2874 #, no-wrap
2875 msgid "Real parent"
2876 msgstr ""
2877
2878 #. type: Plain text
2879 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2880 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2881 msgid ""
2882 "The ptrace API (ab)uses the standard UNIX parent/child signaling over "
2883 "B<waitpid>(2). This used to cause the real parent of the process to stop "
2884 "receiving several kinds of B<waitpid>(2) notifications when the child "
2885 "process is traced by some other process."
2886 msgstr ""
2887
2888 #. type: Plain text
2889 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2890 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2891 msgid ""
2892 "Many of these bugs have been fixed, but as of Linux 2.6.38 several still "
2893 "exist; see BUGS below."
2894 msgstr ""
2895
2896 #. type: Plain text
2897 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2898 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2899 msgid "As of Linux 2.6.38, the following is believed to work correctly:"
2900 msgstr ""
2901
2902 #. type: Plain text
2903 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2904 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2905 msgid ""
2906 "exit/death by signal is reported first to the tracer, then, when the tracer "
2907 "consumes the B<waitpid>(2) result, to the real parent (to the real parent "
2908 "only when the whole multithreaded process exits). If the tracer and the "
2909 "real parent are the same process, the report is sent only once."
2910 msgstr ""
2911
2912 #. type: SH
2913 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2914 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2915 #, no-wrap
2916 msgid "RETURN VALUE"
2917 msgstr ""
2918
2919 #. type: Plain text
2920 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2921 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2922 msgid ""
2923 "On success, the B<PTRACE_PEEK*> operations return the requested data (but "
2924 "see NOTES), the B<PTRACE_SECCOMP_GET_FILTER> operation returns the number of "
2925 "instructions in the BPF program, the B<PTRACE_GET_SYSCALL_INFO> operation "
2926 "returns the number of bytes available to be written by the kernel, and other "
2927 "operations return zero."
2928 msgstr ""
2929
2930 #. type: Plain text
2931 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2932 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2933 msgid ""
2934 "On error, all operations return -1, and I<errno> is set to indicate the "
2935 "error. Since the value returned by a successful B<PTRACE_PEEK*> operation "
2936 "may be -1, the caller must clear I<errno> before the call, and then check it "
2937 "afterward to determine whether or not an error occurred."
2938 msgstr ""
2939
2940 #. type: SH
2941 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2942 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2943 #, no-wrap
2944 msgid "ERRORS"
2945 msgstr ""
2946
2947 #. type: TP
2948 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2949 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2950 #, no-wrap
2951 msgid "B<EBUSY>"
2952 msgstr ""
2953
2954 #. type: Plain text
2955 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2956 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2957 msgid ""
2958 "(i386 only) There was an error with allocating or freeing a debug register."
2959 msgstr ""
2960
2961 #. type: TP
2962 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2963 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2964 #, no-wrap
2965 msgid "B<EFAULT>"
2966 msgstr ""
2967
2968 #. type: Plain text
2969 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2970 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2971 msgid ""
2972 "There was an attempt to read from or write to an invalid area in the "
2973 "tracer's or the tracee's memory, probably because the area wasn't mapped or "
2974 "accessible. Unfortunately, under Linux, different variations of this fault "
2975 "will return B<EIO> or B<EFAULT> more or less arbitrarily."
2976 msgstr ""
2977
2978 #. type: TP
2979 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2980 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2981 #, no-wrap
2982 msgid "B<EINVAL>"
2983 msgstr ""
2984
2985 #. type: Plain text
2986 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2987 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2988 msgid "An attempt was made to set an invalid option."
2989 msgstr ""
2990
2991 #. type: TP
2992 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2993 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2994 #, no-wrap
2995 msgid "B<EIO>"
2996 msgstr ""
2997
2998 #. type: Plain text
2999 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3000 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3001 msgid ""
3002 "I<op> is invalid, or an attempt was made to read from or write to an invalid "
3003 "area in the tracer's or the tracee's memory, or there was a word-alignment "
3004 "violation, or an invalid signal was specified during a restart operation."
3005 msgstr ""
3006
3007 #. type: TP
3008 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3009 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3010 #, no-wrap
3011 msgid "B<EPERM>"
3012 msgstr ""
3013
3014 #. type: Plain text
3015 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3016 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3017 msgid ""
3018 "The specified process cannot be traced. This could be because the tracer "
3019 "has insufficient privileges (the required capability is B<CAP_SYS_PTRACE>); "
3020 "unprivileged processes cannot trace processes that they cannot send signals "
3021 "to or those running set-user-ID/set-group-ID programs, for obvious reasons. "
3022 "Alternatively, the process may already be being traced, or (before Linux "
3023 "2.6.26) be B<init>(1) (PID 1)."
3024 msgstr ""
3025
3026 #. type: TP
3027 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3028 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3029 #, no-wrap
3030 msgid "B<ESRCH>"
3031 msgstr ""
3032
3033 #. type: Plain text
3034 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3035 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3036 msgid ""
3037 "The specified process does not exist, or is not currently being traced by "
3038 "the caller, or is not stopped (for operations that require a stopped tracee)."
3039 msgstr ""
3040
3041 #. type: SH
3042 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3043 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3044 #, no-wrap
3045 msgid "STANDARDS"
3046 msgstr ""
3047
3048 #. type: Plain text
3049 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3050 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3051 msgid "None."
3052 msgstr ""
3053
3054 #. type: SH
3055 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3056 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3057 #, no-wrap
3058 msgid "HISTORY"
3059 msgstr ""
3060
3061 #. type: Plain text
3062 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3063 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3064 msgid "SVr4, 4.3BSD."
3065 msgstr ""
3066
3067 #. See commit 00cd5c37afd5f431ac186dd131705048c0a11fdb
3068 #. type: Plain text
3069 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3070 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3071 msgid ""
3072 "Before Linux 2.6.26, B<init>(1), the process with PID 1, may not be traced."
3073 msgstr ""
3074
3075 #. type: SH
3076 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3077 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3078 #, no-wrap
3079 msgid "NOTES"
3080 msgstr ""
3081
3082 #. type: Plain text
3083 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3084 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3085 msgid ""
3086 "Although arguments to B<ptrace>() are interpreted according to the "
3087 "prototype given, glibc currently declares B<ptrace>() as a variadic "
3088 "function with only the I<op> argument fixed. It is recommended to always "
3089 "supply four arguments, even if the requested operation does not use them, "
3090 "setting unused/ignored arguments to I<0L> or I<(void\\ *)\\ 0>."
3091 msgstr ""
3092
3093 #. type: Plain text
3094 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3095 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3096 msgid ""
3097 "A tracees parent continues to be the tracer even if that tracer calls "
3098 "B<execve>(2)."
3099 msgstr ""
3100
3101 #. See http://lkml.org/lkml/2008/5/8/375
3102 #. type: Plain text
3103 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3104 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3105 msgid ""
3106 "The layout of the contents of memory and the USER area are quite operating-"
3107 "system- and architecture-specific. The offset supplied, and the data "
3108 "returned, might not entirely match with the definition of I<struct user>."
3109 msgstr ""
3110
3111 #. type: Plain text
3112 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3113 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3114 msgid ""
3115 "The size of a \"word\" is determined by the operating-system variant (e.g., "
3116 "for 32-bit Linux it is 32 bits)."
3117 msgstr ""
3118
3119 #
3120 #. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3121 #. type: Plain text
3122 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3123 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3124 msgid ""
3125 "This page documents the way the B<ptrace>() call works currently in Linux. "
3126 "Its behavior differs significantly on other flavors of UNIX. In any case, "
3127 "use of B<ptrace>() is highly specific to the operating system and "
3128 "architecture."
3129 msgstr ""
3130
3131 #. type: SS
3132 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3133 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3134 #, no-wrap
3135 msgid "Ptrace access mode checking"
3136 msgstr ""
3137
3138 #. type: Plain text
3139 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3140 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3141 msgid ""
3142 "Various parts of the kernel-user-space API (not just B<ptrace>() "
3143 "operations), require so-called \"ptrace access mode\" checks, whose outcome "
3144 "determines whether an operation is permitted (or, in a few cases, causes a "
3145 "\"read\" operation to return sanitized data). These checks are performed in "
3146 "cases where one process can inspect sensitive information about, or in some "
3147 "cases modify the state of, another process. The checks are based on factors "
3148 "such as the credentials and capabilities of the two processes, whether or "
3149 "not the \"target\" process is dumpable, and the results of checks performed "
3150 "by any enabled Linux Security Module (LSM)\\[em]for example, SELinux, Yama, "
3151 "or Smack\\[em]and by the commoncap LSM (which is always invoked)."
3152 msgstr ""
3153
3154 #. commit 006ebb40d3d65338bd74abb03b945f8d60e362bd
3155 #. type: Plain text
3156 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3157 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3158 msgid ""
3159 "Prior to Linux 2.6.27, all access checks were of a single type. Since Linux "
3160 "2.6.27, two access mode levels are distinguished:"
3161 msgstr ""
3162
3163 #. type: TP
3164 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3165 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3166 #, no-wrap
3167 msgid "B<PTRACE_MODE_READ>"
3168 msgstr ""
3169
3170 #. type: Plain text
3171 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3172 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3173 msgid ""
3174 "For \"read\" operations or other operations that are less dangerous, such "
3175 "as: B<get_robust_list>(2); B<kcmp>(2); reading I</proc/>pidI</auxv>, I</proc/"
3176 ">pidI</environ>, or I</proc/>pidI</stat>; or B<readlink>(2) of a I</proc/"
3177 ">pidI</ns/*> file."
3178 msgstr ""
3179
3180 #. type: TP
3181 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3182 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3183 #, no-wrap
3184 msgid "B<PTRACE_MODE_ATTACH>"
3185 msgstr ""
3186
3187 #
3188 #
3189 #. #-#-#-#-# archlinux: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3190 #. Regarding the above description of the distinction between
3191 #. PTRACE_MODE_READ and PTRACE_MODE_ATTACH, Stephen Smalley notes:
3192 #. That was the intent when the distinction was introduced, but it doesn't
3193 #. appear to have been properly maintained, e.g., there is now a common
3194 #. helper lock_trace() that is used for
3195 #. /proc/pid/{stack,syscall,personality} but checks PTRACE_MODE_ATTACH, and
3196 #. PTRACE_MODE_ATTACH is also used in timerslack_ns_write/show(). Likely
3197 #. should review and make them consistent. There was also some debate
3198 #. about proper handling of /proc/pid/fd. Arguably that one might belong
3199 #. back in the _ATTACH camp.
3200 #. type: Plain text
3201 #. #-#-#-#-# debian-trixie: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3202 #. Regarding the above description of the distinction between
3203 #. PTRACE_MODE_READ and PTRACE_MODE_ATTACH, Stephen Smalley notes:
3204 #. That was the intent when the distinction was introduced, but it doesn't
3205 #. appear to have been properly maintained, e.g. there is now a common
3206 #. helper lock_trace() that is used for
3207 #. /proc/pid/{stack,syscall,personality} but checks PTRACE_MODE_ATTACH, and
3208 #. PTRACE_MODE_ATTACH is also used in timerslack_ns_write/show(). Likely
3209 #. should review and make them consistent. There was also some debate
3210 #. about proper handling of /proc/pid/fd. Arguably that one might belong
3211 #. back in the _ATTACH camp.
3212 #. type: Plain text
3213 #. #-#-#-#-# debian-unstable: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3214 #. Regarding the above description of the distinction between
3215 #. PTRACE_MODE_READ and PTRACE_MODE_ATTACH, Stephen Smalley notes:
3216 #. That was the intent when the distinction was introduced, but it doesn't
3217 #. appear to have been properly maintained, e.g., there is now a common
3218 #. helper lock_trace() that is used for
3219 #. /proc/pid/{stack,syscall,personality} but checks PTRACE_MODE_ATTACH, and
3220 #. PTRACE_MODE_ATTACH is also used in timerslack_ns_write/show(). Likely
3221 #. should review and make them consistent. There was also some debate
3222 #. about proper handling of /proc/pid/fd. Arguably that one might belong
3223 #. back in the _ATTACH camp.
3224 #. type: Plain text
3225 #. #-#-#-#-# fedora-44: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3226 #. Regarding the above description of the distinction between
3227 #. PTRACE_MODE_READ and PTRACE_MODE_ATTACH, Stephen Smalley notes:
3228 #. That was the intent when the distinction was introduced, but it doesn't
3229 #. appear to have been properly maintained, e.g. there is now a common
3230 #. helper lock_trace() that is used for
3231 #. /proc/pid/{stack,syscall,personality} but checks PTRACE_MODE_ATTACH, and
3232 #. PTRACE_MODE_ATTACH is also used in timerslack_ns_write/show(). Likely
3233 #. should review and make them consistent. There was also some debate
3234 #. about proper handling of /proc/pid/fd. Arguably that one might belong
3235 #. back in the _ATTACH camp.
3236 #. type: Plain text
3237 #. #-#-#-#-# fedora-rawhide: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3238 #. Regarding the above description of the distinction between
3239 #. PTRACE_MODE_READ and PTRACE_MODE_ATTACH, Stephen Smalley notes:
3240 #. That was the intent when the distinction was introduced, but it doesn't
3241 #. appear to have been properly maintained, e.g. there is now a common
3242 #. helper lock_trace() that is used for
3243 #. /proc/pid/{stack,syscall,personality} but checks PTRACE_MODE_ATTACH, and
3244 #. PTRACE_MODE_ATTACH is also used in timerslack_ns_write/show(). Likely
3245 #. should review and make them consistent. There was also some debate
3246 #. about proper handling of /proc/pid/fd. Arguably that one might belong
3247 #. back in the _ATTACH camp.
3248 #. type: Plain text
3249 #. #-#-#-#-# mageia-cauldron: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3250 #. Regarding the above description of the distinction between
3251 #. PTRACE_MODE_READ and PTRACE_MODE_ATTACH, Stephen Smalley notes:
3252 #. That was the intent when the distinction was introduced, but it doesn't
3253 #. appear to have been properly maintained, e.g., there is now a common
3254 #. helper lock_trace() that is used for
3255 #. /proc/pid/{stack,syscall,personality} but checks PTRACE_MODE_ATTACH, and
3256 #. PTRACE_MODE_ATTACH is also used in timerslack_ns_write/show(). Likely
3257 #. should review and make them consistent. There was also some debate
3258 #. about proper handling of /proc/pid/fd. Arguably that one might belong
3259 #. back in the _ATTACH camp.
3260 #. type: Plain text
3261 #. #-#-#-#-# opensuse-leap-16-1: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3262 #. Regarding the above description of the distinction between
3263 #. PTRACE_MODE_READ and PTRACE_MODE_ATTACH, Stephen Smalley notes:
3264 #. That was the intent when the distinction was introduced, but it doesn't
3265 #. appear to have been properly maintained, e.g., there is now a common
3266 #. helper lock_trace() that is used for
3267 #. /proc/pid/{stack,syscall,personality} but checks PTRACE_MODE_ATTACH, and
3268 #. PTRACE_MODE_ATTACH is also used in timerslack_ns_write/show(). Likely
3269 #. should review and make them consistent. There was also some debate
3270 #. about proper handling of /proc/pid/fd. Arguably that one might belong
3271 #. back in the _ATTACH camp.
3272 #. type: Plain text
3273 #. #-#-#-#-# opensuse-tumbleweed: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3274 #. Regarding the above description of the distinction between
3275 #. PTRACE_MODE_READ and PTRACE_MODE_ATTACH, Stephen Smalley notes:
3276 #. That was the intent when the distinction was introduced, but it doesn't
3277 #. appear to have been properly maintained, e.g., there is now a common
3278 #. helper lock_trace() that is used for
3279 #. /proc/pid/{stack,syscall,personality} but checks PTRACE_MODE_ATTACH, and
3280 #. PTRACE_MODE_ATTACH is also used in timerslack_ns_write/show(). Likely
3281 #. should review and make them consistent. There was also some debate
3282 #. about proper handling of /proc/pid/fd. Arguably that one might belong
3283 #. back in the _ATTACH camp.
3284 #. type: Plain text
3285 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3286 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3287 msgid ""
3288 "For \"write\" operations, or other operations that are more dangerous, such "
3289 "as: ptrace attaching (B<PTRACE_ATTACH>) to another process or calling "
3290 "B<process_vm_writev>(2). (B<PTRACE_MODE_ATTACH> was effectively the default "
3291 "before Linux 2.6.27.)"
3292 msgstr ""
3293
3294 #. commit caaee6234d05a58c5b4d05e7bf766131b810a657
3295 #. type: Plain text
3296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3298 msgid ""
3299 "Since Linux 4.5, the above access mode checks are combined (ORed) with one "
3300 "of the following modifiers:"
3301 msgstr ""
3302
3303 #. type: TP
3304 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3305 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3306 #, no-wrap
3307 msgid "B<PTRACE_MODE_FSCREDS>"
3308 msgstr ""
3309
3310 #. type: Plain text
3311 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3312 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3313 msgid ""
3314 "Use the caller's filesystem UID and GID (see B<credentials>(7)) or "
3315 "effective capabilities for LSM checks."
3316 msgstr ""
3317
3318 #. type: TP
3319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3321 #, no-wrap
3322 msgid "B<PTRACE_MODE_REALCREDS>"
3323 msgstr ""
3324
3325 #. type: Plain text
3326 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3327 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3328 msgid ""
3329 "Use the caller's real UID and GID or permitted capabilities for LSM checks. "
3330 "This was effectively the default before Linux 4.5."
3331 msgstr ""
3332
3333 #. type: Plain text
3334 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3335 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3336 msgid ""
3337 "Because combining one of the credential modifiers with one of the "
3338 "aforementioned access modes is typical, some macros are defined in the "
3339 "kernel sources for the combinations:"
3340 msgstr ""
3341
3342 #. type: TP
3343 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3344 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3345 #, no-wrap
3346 msgid "B<PTRACE_MODE_READ_FSCREDS>"
3347 msgstr ""
3348
3349 #. type: Plain text
3350 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3351 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3352 msgid "Defined as B<PTRACE_MODE_READ | PTRACE_MODE_FSCREDS>."
3353 msgstr ""
3354
3355 #. type: TP
3356 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3357 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3358 #, no-wrap
3359 msgid "B<PTRACE_MODE_READ_REALCREDS>"
3360 msgstr ""
3361
3362 #. type: Plain text
3363 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3364 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3365 msgid "Defined as B<PTRACE_MODE_READ | PTRACE_MODE_REALCREDS>."
3366 msgstr ""
3367
3368 #. type: TP
3369 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3370 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3371 #, no-wrap
3372 msgid "B<PTRACE_MODE_ATTACH_FSCREDS>"
3373 msgstr ""
3374
3375 #. type: Plain text
3376 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3377 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3378 msgid "Defined as B<PTRACE_MODE_ATTACH | PTRACE_MODE_FSCREDS>."
3379 msgstr ""
3380
3381 #. type: TP
3382 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3383 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3384 #, no-wrap
3385 msgid "B<PTRACE_MODE_ATTACH_REALCREDS>"
3386 msgstr ""
3387
3388 #. type: Plain text
3389 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3390 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3391 msgid "Defined as B<PTRACE_MODE_ATTACH | PTRACE_MODE_REALCREDS>."
3392 msgstr ""
3393
3394 #. type: Plain text
3395 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3396 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3397 msgid "One further modifier can be ORed with the access mode:"
3398 msgstr ""
3399
3400 #. type: TP
3401 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3402 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3403 #, no-wrap
3404 msgid "B<PTRACE_MODE_NOAUDIT> (since Linux 3.3)"
3405 msgstr ""
3406
3407 #. commit 69f594a38967f4540ce7a29b3fd214e68a8330bd
3408 #. Just for /proc/pid/stat
3409 #. type: Plain text
3410 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3411 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3412 msgid ""
3413 "Don't audit this access mode check. This modifier is employed for ptrace "
3414 "access mode checks (such as checks when reading I</proc/>pidI</stat>) that "
3415 "merely cause the output to be filtered or sanitized, rather than causing an "
3416 "error to be returned to the caller. In these cases, accessing the file is "
3417 "not a security violation and there is no reason to generate a security audit "
3418 "record. This modifier suppresses the generation of such an audit record for "
3419 "the particular access check."
3420 msgstr ""
3421
3422 #. type: Plain text
3423 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3424 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3425 msgid ""
3426 "Note that all of the B<PTRACE_MODE_*> constants described in this subsection "
3427 "are kernel-internal, and not visible to user space. The constant names are "
3428 "mentioned here in order to label the various kinds of ptrace access mode "
3429 "checks that are performed for various system calls and accesses to various "
3430 "pseudofiles (e.g., under I</proc>). These names are used in other manual "
3431 "pages to provide a simple shorthand for labeling the different kernel checks."
3432 msgstr ""
3433
3434 #. type: Plain text
3435 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3436 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3437 msgid ""
3438 "The algorithm employed for ptrace access mode checking determines whether "
3439 "the calling process is allowed to perform the corresponding action on the "
3440 "target process. (In the case of opening I</proc/>pid files, the \"calling "
3441 "process\" is the one opening the file, and the process with the "
3442 "corresponding PID is the \"target process\".) The algorithm is as follows:"
3443 msgstr ""
3444
3445 #. type: IP
3446 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3447 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3448 #, no-wrap
3449 msgid "(1)"
3450 msgstr ""
3451
3452 #. type: Plain text
3453 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3454 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3455 msgid ""
3456 "If the calling thread and the target thread are in the same thread group, "
3457 "access is always allowed."
3458 msgstr ""
3459
3460 #. type: IP
3461 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3462 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3463 #, no-wrap
3464 msgid "(2)"
3465 msgstr ""
3466
3467 #. type: Plain text
3468 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3469 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3470 msgid ""
3471 "If the access mode specifies B<PTRACE_MODE_FSCREDS>, then, for the check in "
3472 "the next step, employ the caller's filesystem UID and GID. (As noted in "
3473 "B<credentials>(7), the filesystem UID and GID almost always have the same "
3474 "values as the corresponding effective IDs.)"
3475 msgstr ""
3476
3477 #. type: Plain text
3478 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3479 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3480 msgid ""
3481 "Otherwise, the access mode specifies B<PTRACE_MODE_REALCREDS>, so use the "
3482 "caller's real UID and GID for the checks in the next step. (Most APIs that "
3483 "check the caller's UID and GID use the effective IDs. For historical "
3484 "reasons, the B<PTRACE_MODE_REALCREDS> check uses the real IDs instead.)"
3485 msgstr ""
3486
3487 #. type: IP
3488 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3489 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3490 #, no-wrap
3491 msgid "(3)"
3492 msgstr ""
3493
3494 #. type: Plain text
3495 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3496 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3497 msgid "Deny access if I<neither> of the following is true:"
3498 msgstr ""
3499
3500 #. type: Plain text
3501 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3502 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3503 msgid ""
3504 "The real, effective, and saved-set user IDs of the target match the caller's "
3505 "user ID, I<and> the real, effective, and saved-set group IDs of the target "
3506 "match the caller's group ID."
3507 msgstr ""
3508
3509 #. type: Plain text
3510 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3511 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3512 msgid ""
3513 "The caller has the B<CAP_SYS_PTRACE> capability in the user namespace of the "
3514 "target."
3515 msgstr ""
3516
3517 #. type: IP
3518 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3519 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3520 #, no-wrap
3521 msgid "(4)"
3522 msgstr ""
3523
3524 #. type: Plain text
3525 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3526 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3527 msgid ""
3528 "Deny access if the target process \"dumpable\" attribute has a value other "
3529 "than 1 (B<SUID_DUMP_USER>; see the discussion of B<PR_SET_DUMPABLE> in "
3530 "B<prctl>(2)), and the caller does not have the B<CAP_SYS_PTRACE> capability "
3531 "in the user namespace of the target process."
3532 msgstr ""
3533
3534 #. type: IP
3535 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3536 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3537 #, no-wrap
3538 msgid "(5)"
3539 msgstr ""
3540
3541 #. (in cap_ptrace_access_check()):
3542 #. type: Plain text
3543 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3544 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3545 msgid ""
3546 "The kernel LSM I<security_ptrace_access_check>() interface is invoked to "
3547 "see if ptrace access is permitted. The results depend on the LSM(s). The "
3548 "implementation of this interface in the commoncap LSM performs the following "
3549 "steps:"
3550 msgstr ""
3551
3552 #. type: IP
3553 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3554 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3555 #, no-wrap
3556 msgid "(5.1)"
3557 msgstr ""
3558
3559 #. type: Plain text
3560 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3561 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3562 msgid ""
3563 "If the access mode includes B<PTRACE_MODE_FSCREDS>, then use the caller's "
3564 "I<effective> capability set in the following check; otherwise (the access "
3565 "mode specifies B<PTRACE_MODE_REALCREDS>, so) use the caller's I<permitted> "
3566 "capability set."
3567 msgstr ""
3568
3569 #. type: IP
3570 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3571 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3572 #, no-wrap
3573 msgid "(5.2)"
3574 msgstr ""
3575
3576 #. type: Plain text
3577 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3578 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3579 msgid ""
3580 "The caller and the target process are in the same user namespace, and the "
3581 "caller's capabilities are a superset of the target process's I<permitted> "
3582 "capabilities."
3583 msgstr ""
3584
3585 #. type: Plain text
3586 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3587 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3588 msgid ""
3589 "The caller has the B<CAP_SYS_PTRACE> capability in the target process's user "
3590 "namespace."
3591 msgstr ""
3592
3593 #. type: Plain text
3594 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3595 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3596 msgid ""
3597 "Note that the commoncap LSM does not distinguish between B<PTRACE_MODE_READ> "
3598 "and B<PTRACE_MODE_ATTACH>."
3599 msgstr ""
3600
3601 #. type: IP
3602 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3603 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3604 #, no-wrap
3605 msgid "(6)"
3606 msgstr ""
3607
3608 #
3609 #. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3610 #. type: Plain text
3611 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3612 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3613 msgid ""
3614 "If access has not been denied by any of the preceding steps, then access is "
3615 "allowed."
3616 msgstr ""
3617
3618 #. type: SS
3619 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3620 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3621 #, no-wrap
3622 msgid "/proc/sys/kernel/yama/ptrace_scope"
3623 msgstr ""
3624
3625 #. commit 2d514487faf188938a4ee4fb3464eeecfbdcf8eb
3626 #. type: Plain text
3627 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3628 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3629 msgid ""
3630 "On systems with the Yama Linux Security Module (LSM) installed (i.e., the "
3631 "kernel was configured with B<CONFIG_SECURITY_YAMA>), the I</proc/sys/kernel/"
3632 "yama/ptrace_scope> file (available since Linux 3.4) can be used to restrict "
3633 "the ability to trace a process with B<ptrace>() (and thus also the ability "
3634 "to use tools such as B<strace>(1) and B<gdb>(1)). The goal of such "
3635 "restrictions is to prevent attack escalation whereby a compromised process "
3636 "can ptrace-attach to other sensitive processes (e.g., a GPG agent or an SSH "
3637 "session) owned by the user in order to gain additional credentials that may "
3638 "exist in memory and thus expand the scope of the attack."
3639 msgstr ""
3640
3641 #. type: Plain text
3642 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3643 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3644 msgid "More precisely, the Yama LSM limits two types of operations:"
3645 msgstr ""
3646
3647 #. type: Plain text
3648 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3649 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3650 msgid ""
3651 "Any operation that performs a ptrace access mode B<PTRACE_MODE_ATTACH> "
3652 "check\\[em]for example, B<ptrace>() B<PTRACE_ATTACH>. (See the \"Ptrace "
3653 "access mode checking\" discussion above.)"
3654 msgstr ""
3655
3656 #. type: Plain text
3657 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3658 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3659 msgid "B<ptrace>() B<PTRACE_TRACEME>."
3660 msgstr ""
3661
3662 #. type: Plain text
3663 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3664 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3665 msgid ""
3666 "A process that has the B<CAP_SYS_PTRACE> capability can update the I</proc/"
3667 "sys/kernel/yama/ptrace_scope> file with one of the following values:"
3668 msgstr ""
3669
3670 #. type: TP
3671 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3672 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3673 #, no-wrap
3674 msgid "0 (\"classic ptrace permissions\")"
3675 msgstr ""
3676
3677 #. type: Plain text
3678 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3679 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3680 msgid ""
3681 "No additional restrictions on operations that perform B<PTRACE_MODE_ATTACH> "
3682 "checks (beyond those imposed by the commoncap and other LSMs)."
3683 msgstr ""
3684
3685 #. type: Plain text
3686 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3687 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3688 msgid "The use of B<PTRACE_TRACEME> is unchanged."
3689 msgstr ""
3690
3691 #. type: TP
3692 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3693 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3694 #, no-wrap
3695 msgid "1 (\"restricted ptrace\") [default value]"
3696 msgstr ""
3697
3698 #. type: Plain text
3699 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3700 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3701 msgid ""
3702 "When performing an operation that requires a B<PTRACE_MODE_ATTACH> check, "
3703 "the calling process must either have the B<CAP_SYS_PTRACE> capability in the "
3704 "user namespace of the target process or it must have a predefined "
3705 "relationship with the target process. By default, the predefined "
3706 "relationship is that the target process must be a descendant of the caller."
3707 msgstr ""
3708
3709 #. type: Plain text
3710 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
3711 #: opensuse-tumbleweed
3712 msgid ""
3713 "A target process can employ the B<prctl>(2) B<PR_SET_PTRACER> operation to "
3714 "declare an additional PID that is allowed to perform B<PTRACE_MODE_ATTACH> "
3715 "operations on the target. See the kernel source file I<Documentation/admin-"
3716 "guide/LSM/Yama.rst> for further details."
3717 msgstr ""
3718
3719 #. type: TP
3720 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3721 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3722 #, no-wrap
3723 msgid "2 (\"admin-only attach\")"
3724 msgstr ""
3725
3726 #. type: Plain text
3727 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3728 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3729 msgid ""
3730 "Only processes with the B<CAP_SYS_PTRACE> capability in the user namespace "
3731 "of the target process may perform B<PTRACE_MODE_ATTACH> operations or trace "
3732 "children that employ B<PTRACE_TRACEME>."
3733 msgstr ""
3734
3735 #. type: TP
3736 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3737 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3738 #, no-wrap
3739 msgid "3 (\"no attach\")"
3740 msgstr ""
3741
3742 #. type: Plain text
3743 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3744 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3745 msgid ""
3746 "No process may perform B<PTRACE_MODE_ATTACH> operations or trace children "
3747 "that employ B<PTRACE_TRACEME>."
3748 msgstr ""
3749
3750 #. type: Plain text
3751 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3752 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3753 msgid "Once this value has been written to the file, it cannot be changed."
3754 msgstr ""
3755
3756 #
3757 #. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3758 #. type: Plain text
3759 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3760 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3761 msgid ""
3762 "With respect to values 1 and 2, note that creating a new user namespace "
3763 "effectively removes the protection offered by Yama. This is because a "
3764 "process in the parent user namespace whose effective UID matches the UID of "
3765 "the creator of a child namespace has all capabilities (including "
3766 "B<CAP_SYS_PTRACE>) when performing operations within the child user "
3767 "namespace (and further-removed descendants of that namespace). "
3768 "Consequently, when a process tries to use user namespaces to sandbox itself, "
3769 "it inadvertently weakens the protections offered by the Yama LSM."
3770 msgstr ""
3771
3772 #. type: SS
3773 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3774 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3775 #, no-wrap
3776 msgid "C library/kernel differences"
3777 msgstr ""
3778
3779 #. type: Plain text
3780 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3781 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3782 msgid ""
3783 "At the system call level, the B<PTRACE_PEEKTEXT>, B<PTRACE_PEEKDATA>, and "
3784 "B<PTRACE_PEEKUSER> operations have a different API: they store the result at "
3785 "the address specified by the I<data> parameter, and the return value is the "
3786 "error flag. The glibc wrapper function provides the API given in "
3787 "DESCRIPTION above, with the result being returned via the function return "
3788 "value."
3789 msgstr ""
3790
3791 #. type: SH
3792 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3793 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3794 #, no-wrap
3795 msgid "BUGS"
3796 msgstr ""
3797
3798 #. type: Plain text
3799 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3800 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3801 msgid ""
3802 "On hosts with Linux 2.6 kernel headers, B<PTRACE_SETOPTIONS> is declared "
3803 "with a different value than the one for Linux 2.4. This leads to "
3804 "applications compiled with Linux 2.6 kernel headers failing when run on "
3805 "Linux 2.4. This can be worked around by redefining B<PTRACE_SETOPTIONS> to "
3806 "B<PTRACE_OLDSETOPTIONS>, if that is defined."
3807 msgstr ""
3808
3809 #. type: Plain text
3810 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3811 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3812 msgid ""
3813 "Group-stop notifications are sent to the tracer, but not to real parent. "
3814 "Last confirmed on 2.6.38.6."
3815 msgstr ""
3816
3817 #. #-#-#-#-# archlinux: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3818 #. Note from Denys Vlasenko:
3819 #. Here "exits" means any kind of death - _exit, exit_group,
3820 #. signal death. Signal death and exit_group cases are trivial,
3821 #. though: since signal death and exit_group kill all other threads
3822 #. too, "until all other threads exit" thing happens rather soon
3823 #. in these cases. Therefore, only _exit presents observably
3824 #. puzzling behavior to ptrace users: thread leader _exit's,
3825 #. but WIFEXITED isn't reported! We are trying to explain here
3826 #. why it is so.
3827 #. FIXME . need to test/verify this scenario
3828 #. type: Plain text
3829 #. #-#-#-#-# debian-trixie: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3830 #. Note from Denys Vlasenko:
3831 #. Here "exits" means any kind of death - _exit, exit_group,
3832 #. signal death. Signal death and exit_group cases are trivial,
3833 #. though: since signal death and exit_group kill all other threads
3834 #. too, "until all other threads exit" thing happens rather soon
3835 #. in these cases. Therefore, only _exit presents observably
3836 #. puzzling behavior to ptrace users: thread leader _exit's,
3837 #. but WIFEXITED isn't reported! We are trying to explain here
3838 #. why it is so.
3839 #. FIXME . need to test/verify this scenario
3840 #. type: Plain text
3841 #. #-#-#-#-# debian-unstable: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3842 #. Note from Denys Vlasenko:
3843 #. Here "exits" means any kind of death - _exit, exit_group,
3844 #. signal death. Signal death and exit_group cases are trivial,
3845 #. though: since signal death and exit_group kill all other threads
3846 #. too, "until all other threads exit" thing happens rather soon
3847 #. in these cases. Therefore, only _exit presents observably
3848 #. puzzling behavior to ptrace users: thread leader _exit's,
3849 #. but WIFEXITED isn't reported! We are trying to explain here
3850 #. why it is so.
3851 #. FIXME . need to test/verify this scenario
3852 #. type: Plain text
3853 #. #-#-#-#-# fedora-44: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3854 #. Note from Denys Vlasenko:
3855 #. Here "exits" means any kind of death - _exit, exit_group,
3856 #. signal death. Signal death and exit_group cases are trivial,
3857 #. though: since signal death and exit_group kill all other threads
3858 #. too, "until all other threads exit" thing happens rather soon
3859 #. in these cases. Therefore, only _exit presents observably
3860 #. puzzling behavior to ptrace users: thread leader _exit's,
3861 #. but WIFEXITED isn't reported! We are trying to explain here
3862 #. why it is so.
3863 #. FIXME . need to test/verify this scenario
3864 #. type: Plain text
3865 #. #-#-#-#-# fedora-rawhide: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3866 #. Note from Denys Vlasenko:
3867 #. Here "exits" means any kind of death - _exit, exit_group,
3868 #. signal death. Signal death and exit_group cases are trivial,
3869 #. though: since signal death and exit_group kill all other threads
3870 #. too, "until all other threads exit" thing happens rather soon
3871 #. in these cases. Therefore, only _exit presents observably
3872 #. puzzling behavior to ptrace users: thread leader _exit's,
3873 #. but WIFEXITED isn't reported! We are trying to explain here
3874 #. why it is so.
3875 #. FIXME . need to test/verify this scenario
3876 #. type: Plain text
3877 #. #-#-#-#-# mageia-cauldron: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3878 #. Note from Denys Vlasenko:
3879 #. Here "exits" means any kind of death - _exit, exit_group,
3880 #. signal death. Signal death and exit_group cases are trivial,
3881 #. though: since signal death and exit_group kill all other threads
3882 #. too, "until all other threads exit" thing happens rather soon
3883 #. in these cases. Therefore, only _exit presents observably
3884 #. puzzling behavior to ptrace users: thread leader _exit's,
3885 #. but WIFEXITED isn't reported! We are trying to explain here
3886 #. why it is so.
3887 #. FIXME . need to test/verify this scenario
3888 #. type: Plain text
3889 #. #-#-#-#-# opensuse-leap-16-1: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3890 #. Note from Denys Vlasenko:
3891 #. Here "exits" means any kind of death - _exit, exit_group,
3892 #. signal death. Signal death and exit_group cases are trivial,
3893 #. though: since signal death and exit_group kill all other threads
3894 #. too, "until all other threads exit" thing happens rather soon
3895 #. in these cases. Therefore, only _exit presents observably
3896 #. puzzling behavior to ptrace users: thread leader _exit's,
3897 #. but WIFEXITED isn't reported! We are trying to explain here
3898 #. why it is so.
3899 #. FIXME . need to test/verify this scenario
3900 #. type: Plain text
3901 #. #-#-#-#-# opensuse-tumbleweed: ptrace.2.pot (PACKAGE VERSION) #-#-#-#-#
3902 #. Note from Denys Vlasenko:
3903 #. Here "exits" means any kind of death - _exit, exit_group,
3904 #. signal death. Signal death and exit_group cases are trivial,
3905 #. though: since signal death and exit_group kill all other threads
3906 #. too, "until all other threads exit" thing happens rather soon
3907 #. in these cases. Therefore, only _exit presents observably
3908 #. puzzling behavior to ptrace users: thread leader _exit's,
3909 #. but WIFEXITED isn't reported! We are trying to explain here
3910 #. why it is so.
3911 #. FIXME . need to test/verify this scenario
3912 #. type: Plain text
3913 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3914 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3915 msgid ""
3916 "If a thread group leader is traced and exits by calling B<_exit>(2), a "
3917 "B<PTRACE_EVENT_EXIT> stop will happen for it (if requested), but the "
3918 "subsequent B<WIFEXITED> notification will not be delivered until all other "
3919 "threads exit. As explained above, if one of other threads calls "
3920 "B<execve>(2), the death of the thread group leader will I<never> be "
3921 "reported. If the execed thread is not traced by this tracer, the tracer "
3922 "will never know that B<execve>(2) happened. One possible workaround is to "
3923 "B<PTRACE_DETACH> the thread group leader instead of restarting it in this "
3924 "case. Last confirmed on 2.6.38.6."
3925 msgstr ""
3926
3927 #. type: Plain text
3928 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3929 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3930 msgid ""
3931 "A B<SIGKILL> signal may still cause a B<PTRACE_EVENT_EXIT> stop before "
3932 "actual signal death. This may be changed in the future; B<SIGKILL> is meant "
3933 "to always immediately kill tasks even under ptrace. Last confirmed on Linux "
3934 "3.13."
3935 msgstr ""
3936
3937 #. type: Plain text
3938 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3939 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3940 msgid ""
3941 "Some system calls return with B<EINTR> if a signal was sent to a tracee, but "
3942 "delivery was suppressed by the tracer. (This is very typical operation: it "
3943 "is usually done by debuggers on every attach, in order to not introduce a "
3944 "bogus B<SIGSTOP>). As of Linux 3.2.9, the following system calls are "
3945 "affected (this list is likely incomplete): B<epoll_wait>(2), and B<read>(2) "
3946 "from an B<inotify>(7) file descriptor. The usual symptom of this bug is "
3947 "that when you attach to a quiescent process with the command"
3948 msgstr ""
3949
3950 #. type: Plain text
3951 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3952 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3953 #, no-wrap
3954 msgid "strace -p E<lt>process-IDE<gt>\n"
3955 msgstr ""
3956
3957 #. type: Plain text
3958 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3959 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3960 msgid "then, instead of the usual and expected one-line output such as"
3961 msgstr ""
3962
3963 #. type: Plain text
3964 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
3965 #: opensuse-tumbleweed
3966 #, no-wrap
3967 msgid "restart_syscall(E<lt>...\\& resuming interrupted call ...E<gt>_\n"
3968 msgstr ""
3969
3970 #. type: Plain text
3971 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3972 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3973 #, no-wrap
3974 msgid "select(6, [5], NULL, [5], NULL_\n"
3975 msgstr ""
3976
3977 #. type: Plain text
3978 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3979 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3980 msgid ""
3981 "('_' denotes the cursor position), you observe more than one line. For "
3982 "example:"
3983 msgstr ""
3984
3985 #. type: Plain text
3986 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3987 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3988 #, no-wrap
3989 msgid ""
3990 " clock_gettime(CLOCK_MONOTONIC, {15370, 690928118}) = 0\n"
3991 " epoll_wait(4,_\n"
3992 msgstr ""
3993
3994 #. type: Plain text
3995 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
3996 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
3997 msgid ""
3998 "What is not visible here is that the process was blocked in "
3999 "B<epoll_wait>(2) before B<strace>(1) has attached to it. Attaching caused "
4000 "B<epoll_wait>(2) to return to user space with the error B<EINTR>. In this "
4001 "particular case, the program reacted to B<EINTR> by checking the current "
4002 "time, and then executing B<epoll_wait>(2) again. (Programs which do not "
4003 "expect such \"stray\" B<EINTR> errors may behave in an unintended way upon "
4004 "an B<strace>(1) attach.)"
4005 msgstr ""
4006
4007 #. type: Plain text
4008 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
4009 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
4010 msgid ""
4011 "Contrary to the normal rules, the glibc wrapper for B<ptrace>() can set "
4012 "I<errno> to zero."
4013 msgstr ""
4014
4015 #. type: SH
4016 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
4017 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
4018 #, no-wrap
4019 msgid "SEE ALSO"
4020 msgstr ""
4021
4022 #. type: Plain text
4023 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
4024 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
4025 msgid ""
4026 "B<gdb>(1), B<ltrace>(1), B<strace>(1), B<clone>(2), B<execve>(2), "
4027 "B<fork>(2), B<gettid>(2), B<prctl>(2), B<seccomp>(2), B<sigaction>(2), "
4028 "B<tgkill>(2), B<vfork>(2), B<waitpid>(2), B<exec>(3), B<capabilities>(7), "
4029 "B<signal>(7)"
4030 msgstr ""
4031
4032 #. type: TH
4033 #: debian-trixie
4034 #, no-wrap
4035 msgid "2024-05-02"
4036 msgstr ""
4037
4038 #. type: TH
4039 #: debian-trixie
4040 #, no-wrap
4041 msgid "Linux man-pages 6.9.1"
4042 msgstr ""
4043
4044 #. type: Plain text
4045 #: debian-trixie
4046 msgid "Standard C library (I<libc>, I<-lc>)"
4047 msgstr ""
4048
4049 #. type: Plain text
4050 #: debian-trixie
4051 msgid ""
4052 "Read the tracee's registers. I<addr> specifies, in an architecture-"
4053 "dependent way, the type of registers to be read. B<NT_PRSTATUS> (with "
4054 "numerical value 1) usually results in reading of general-purpose "
4055 "registers. If the CPU has, for example, floating-point and/or vector "
4056 "registers, they can be retrieved by setting I<addr> to the corresponding "
4057 "B<NT_foo> constant. I<data> points to a B<struct iovec>, which describes "
4058 "the destination buffer's location and length. On return, the kernel "
4059 "modifies B<iov.len> to indicate the actual number of bytes returned."
4060 msgstr ""
4061
4062 #. type: Plain text
4063 #: debian-trixie fedora-44 fedora-rawhide
4064 #, no-wrap
4065 msgid ""
4066 "struct ptrace_syscall_info {\n"
4067 " __u8 op; /* Type of system call stop */\n"
4068 " __u32 arch; /* AUDIT_ARCH_* value; see seccomp(2) */\n"
4069 " __u64 instruction_pointer; /* CPU instruction pointer */\n"
4070 " __u64 stack_pointer; /* CPU stack pointer */\n"
4071 " union {\n"
4072 " struct { /* op == PTRACE_SYSCALL_INFO_ENTRY */\n"
4073 " __u64 nr; /* System call number */\n"
4074 " __u64 args[6]; /* System call arguments */\n"
4075 " } entry;\n"
4076 " struct { /* op == PTRACE_SYSCALL_INFO_EXIT */\n"
4077 " __s64 rval; /* System call return value */\n"
4078 " __u8 is_error; /* System call error flag;\n"
4079 " Boolean: does rval contain\n"
4080 " an error value (-ERRCODE) or\n"
4081 " a nonerror return value? */\n"
4082 " } exit;\n"
4083 " struct { /* op == PTRACE_SYSCALL_INFO_SECCOMP */\n"
4084 " __u64 nr; /* System call number */\n"
4085 " __u64 args[6]; /* System call arguments */\n"
4086 " __u32 ret_data; /* SECCOMP_RET_DATA portion\n"
4087 " of SECCOMP_RET_TRACE\n"
4088 " return value */\n"
4089 " } seccomp;\n"
4090 " };\n"
4091 "};\n"
4092 msgstr ""
4093
4094 #. type: Plain text
4095 #: debian-trixie fedora-44 fedora-rawhide
4096 #, no-wrap
4097 msgid ""
4098 "*** we get syscall-enter-stop in thread 1: **\n"
4099 "PID1 execve(\"/bin/foo\", \"foo\" E<lt>unfinished ...E<gt>\n"
4100 "*** we issue PTRACE_SYSCALL for thread 1 **\n"
4101 "*** we get syscall-enter-stop in thread 2: **\n"
4102 "PID2 execve(\"/bin/bar\", \"bar\" E<lt>unfinished ...E<gt>\n"
4103 "*** we issue PTRACE_SYSCALL for thread 2 **\n"
4104 "*** we get PTRACE_EVENT_EXEC for PID0, we issue PTRACE_SYSCALL **\n"
4105 "*** we get syscall-exit-stop for PID0: **\n"
4106 "PID0 E<lt>... execve resumedE<gt> ) = 0\n"
4107 msgstr ""
4108
4109 #. commit 90bb766440f2147486a2acc3e793d7b8348b0c22
4110 #. type: Plain text
4111 #: debian-trixie fedora-44 fedora-rawhide
4112 msgid ""
4113 "A target process can employ the B<prctl>(2) B<PR_SET_PTRACER> operation to "
4114 "declare an additional PID that is allowed to perform B<PTRACE_MODE_ATTACH> "
4115 "operations on the target. See the kernel source file I<Documentation/admin-"
4116 "guide/LSM/Yama.rst> (or I<Documentation/security/Yama.txt> before Linux "
4117 "4.13) for further details."
4118 msgstr ""
4119
4120 #. type: Plain text
4121 #: debian-trixie fedora-44 fedora-rawhide
4122 #, no-wrap
4123 msgid "restart_syscall(E<lt>... resuming interrupted call ...E<gt>_\n"
4124 msgstr ""
4125
4126 #. type: TH
4127 #: fedora-44 fedora-rawhide
4128 #, no-wrap
4129 msgid "2024-11-17"
4130 msgstr ""
4131
4132 #. type: TH
4133 #: fedora-44 fedora-rawhide
4134 #, no-wrap
4135 msgid "Linux man-pages 6.13"
4136 msgstr ""
4137
4138 #. type: TH
4139 #: mageia-cauldron
4140 #, no-wrap
4141 msgid "Linux man-pages 6.17"
4142 msgstr ""
4143
4144 #. type: TH
4145 #: opensuse-leap-16-1 opensuse-tumbleweed
4146 #, no-wrap
4147 msgid "Linux man-pages (unreleased)"
4148 msgstr ""