Debian Codegraph @

templates/man7/pkeys.7.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:35+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 "pkeys"
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-08"
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 "pkeys - overview of Memory Protection Keys"
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 "DESCRIPTION"
57 msgstr ""
58
59 #. type: Plain text
60 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
61 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
62 msgid ""
63 "Memory Protection Keys (pkeys) are an extension to existing page-based "
64 "memory permissions. Normal page permissions using page tables require "
65 "expensive system calls and TLB invalidations when changing permissions. "
66 "Memory Protection Keys provide a mechanism for changing protections without "
67 "requiring modification of the page tables on every permission change."
68 msgstr ""
69
70 #. type: Plain text
71 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
72 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
73 msgid ""
74 "To use pkeys, software must first \"tag\" a page in the page tables with a "
75 "pkey. After this tag is in place, an application only has to change the "
76 "contents of a register in order to remove write access, or all access to a "
77 "tagged page."
78 msgstr ""
79
80 #. type: Plain text
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 msgid ""
84 "Protection keys work in conjunction with the existing B<PROT_READ>, "
85 "B<PROT_WRITE>, and B<PROT_EXEC> permissions passed to system calls such as "
86 "B<mprotect>(2) and B<mmap>(2), but always act to further restrict these "
87 "traditional permission mechanisms."
88 msgstr ""
89
90 #. type: Plain text
91 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
92 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
93 msgid ""
94 "If a process performs an access that violates pkey restrictions, it receives "
95 "a B<SIGSEGV> signal. See B<sigaction>(2) for details of the information "
96 "available with that signal."
97 msgstr ""
98
99 #. type: Plain text
100 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
101 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
102 msgid ""
103 "To use the pkeys feature, the processor must support it, and the kernel must "
104 "contain support for the feature on a given processor. As of early 2016 only "
105 "future Intel x86 processors are supported, and this hardware supports 16 "
106 "protection keys in each process. However, pkey 0 is used as the default "
107 "key, so a maximum of 15 are available for actual application use. The "
108 "default key is assigned to any memory region for which a pkey has not been "
109 "explicitly assigned via B<pkey_mprotect>(2)."
110 msgstr ""
111
112 #. type: Plain text
113 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
114 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
115 msgid ""
116 "Protection keys have the potential to add a layer of security and "
117 "reliability to applications. But they have not been primarily designed as a "
118 "security feature. For instance, WRPKRU is a completely unprivileged "
119 "instruction, so pkeys are useless in any case that an attacker controls the "
120 "PKRU register or can execute arbitrary instructions."
121 msgstr ""
122
123 #. type: Plain text
124 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
125 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
126 msgid ""
127 "Applications should be very careful to ensure that they do not \"leak\" "
128 "protection keys. For instance, before calling B<pkey_free>(2), the "
129 "application should be sure that no memory has that pkey assigned. If the "
130 "application left the freed pkey assigned, a future user of that pkey might "
131 "inadvertently change the permissions of an unrelated data structure, which "
132 "could impact security or stability. The kernel currently allows in-use "
133 "pkeys to have B<pkey_free>(2) called on them because it would have "
134 "processor or memory performance implications to perform the additional "
135 "checks needed to disallow it. Implementation of the necessary checks is "
136 "left up to applications. Applications may implement these checks by "
137 "searching the I</proc/>pidI</smaps> file for memory regions with the pkey "
138 "assigned. Further details can be found in B<proc>(5)."
139 msgstr ""
140
141 #. type: Plain text
142 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
143 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
144 msgid ""
145 "Any application wanting to use protection keys needs to be able to function "
146 "without them. They might be unavailable because the hardware that the "
147 "application runs on does not support them, the kernel code does not contain "
148 "support, the kernel support has been disabled, or because the keys have all "
149 "been allocated, perhaps by a library the application is using. It is "
150 "recommended that applications wanting to use protection keys should simply "
151 "call B<pkey_alloc>(2) and test whether the call succeeds, instead of "
152 "attempting to detect support for the feature in any other way."
153 msgstr ""
154
155 #. type: Plain text
156 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
157 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
158 msgid ""
159 "Although unnecessary, hardware support for protection keys may be enumerated "
160 "with the I<cpuid> instruction. Details of how to do this can be found in "
161 "the Intel Software Developers Manual. The kernel performs this enumeration "
162 "and exposes the information in I</proc/cpuinfo> under the \"flags\" field. "
163 "The string \"pku\" in this field indicates hardware support for protection "
164 "keys and the string \"ospke\" indicates that the kernel contains and has "
165 "enabled protection keys support."
166 msgstr ""
167
168 #. type: Plain text
169 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
170 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
171 msgid ""
172 "Applications using threads and protection keys should be especially "
173 "careful. Threads inherit the protection key rights of the parent at the "
174 "time of the B<clone>(2), system call. Applications should either ensure "
175 "that their own permissions are appropriate for child threads at the time "
176 "when B<clone>(2) is called, or ensure that each child thread can perform "
177 "its own initialization of protection key rights."
178 msgstr ""
179
180 #. type: SS
181 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
182 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
183 #, no-wrap
184 msgid "Signal Handler Behavior"
185 msgstr ""
186
187 #. type: Plain text
188 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
189 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
190 msgid ""
191 "Each time a signal handler is invoked (including nested signals), the thread "
192 "is temporarily given a new, default set of protection key rights that "
193 "override the rights from the interrupted context. This means that "
194 "applications must re-establish their desired protection key rights upon "
195 "entering a signal handler if the desired rights differ from the defaults. "
196 "The rights of any interrupted context are restored when the signal handler "
197 "returns."
198 msgstr ""
199
200 #. type: Plain text
201 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
202 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
203 msgid ""
204 "This signal behavior is unusual and is due to the fact that the x86 PKRU "
205 "register (which stores protection key access rights) is managed with the "
206 "same hardware mechanism (XSAVE) that manages floating-point registers. The "
207 "signal behavior is the same as that of floating-point registers."
208 msgstr ""
209
210 #. type: SS
211 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
212 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
213 #, no-wrap
214 msgid "Protection Keys system calls"
215 msgstr ""
216
217 #. type: Plain text
218 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
219 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
220 msgid ""
221 "The Linux kernel implements the following pkey-related system calls: "
222 "B<pkey_mprotect>(2), B<pkey_alloc>(2), and B<pkey_free>(2)."
223 msgstr ""
224
225 #. type: Plain text
226 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
227 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
228 msgid ""
229 "The Linux pkey system calls are available only if the kernel was configured "
230 "and built with the B<CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS> option."
231 msgstr ""
232
233 #. type: SH
234 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
235 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
236 #, no-wrap
237 msgid "EXAMPLES"
238 msgstr ""
239
240 #. type: Plain text
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 msgid ""
244 "The program below allocates a page of memory with read and write "
245 "permissions. It then writes some data to the memory and successfully reads "
246 "it back. After that, it attempts to allocate a protection key and disallows "
247 "access to the page by using the WRPKRU instruction. It then tries to access "
248 "the page, which we now expect to cause a fatal signal to the application."
249 msgstr ""
250
251 #. type: Plain text
252 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
253 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
254 #, no-wrap
255 msgid ""
256 "$B< ./a.out>\n"
257 "buffer contains: 73\n"
258 "about to read buffer again...\n"
259 "Segmentation fault (core dumped)\n"
260 msgstr ""
261
262 #. type: SS
263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
265 #, no-wrap
266 msgid "Program source"
267 msgstr ""
268
269 #. type: Plain text
270 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
271 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
272 #, no-wrap
273 msgid ""
274 "#define _GNU_SOURCE\n"
275 "#include E<lt>err.hE<gt>\n"
276 "#include E<lt>unistd.hE<gt>\n"
277 "#include E<lt>stdio.hE<gt>\n"
278 "#include E<lt>stdlib.hE<gt>\n"
279 "#include E<lt>sys/mman.hE<gt>\n"
280 "\\&\n"
281 "int\n"
282 "main(void)\n"
283 "{\n"
284 " int status;\n"
285 " int pkey;\n"
286 " int *buffer;\n"
287 "\\&\n"
288 " /*\n"
289 " * Allocate one page of memory.\n"
290 " */\n"
291 " buffer = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE,\n"
292 " MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);\n"
293 " if (buffer == MAP_FAILED)\n"
294 " err(EXIT_FAILURE, \"mmap\");\n"
295 "\\&\n"
296 " /*\n"
297 " * Put some random data into the page (still OK to touch).\n"
298 " */\n"
299 " *buffer = __LINE__;\n"
300 " printf(\"buffer contains: %d\\[rs]n\", *buffer);\n"
301 "\\&\n"
302 " /*\n"
303 " * Allocate a protection key:\n"
304 " */\n"
305 " pkey = pkey_alloc(0, 0);\n"
306 " if (pkey == -1)\n"
307 " err(EXIT_FAILURE, \"pkey_alloc\");\n"
308 "\\&\n"
309 " /*\n"
310 " * Disable access to any memory with \"pkey\" set,\n"
311 " * even though there is none right now.\n"
312 " */\n"
313 " status = pkey_set(pkey, PKEY_DISABLE_ACCESS);\n"
314 " if (status)\n"
315 " err(EXIT_FAILURE, \"pkey_set\");\n"
316 "\\&\n"
317 " /*\n"
318 " * Set the protection key on \"buffer\".\n"
319 " * Note that it is still read/write as far as mprotect() is\n"
320 " * concerned and the previous pkey_set() overrides it.\n"
321 " */\n"
322 " status = pkey_mprotect(buffer, getpagesize(),\n"
323 " PROT_READ | PROT_WRITE, pkey);\n"
324 " if (status == -1)\n"
325 " err(EXIT_FAILURE, \"pkey_mprotect\");\n"
326 "\\&\n"
327 " printf(\"about to read buffer again...\\[rs]n\");\n"
328 "\\&\n"
329 " /*\n"
330 " * This will crash, because we have disallowed access.\n"
331 " */\n"
332 " printf(\"buffer contains: %d\\[rs]n\", *buffer);\n"
333 "\\&\n"
334 " status = pkey_free(pkey);\n"
335 " if (status == -1)\n"
336 " err(EXIT_FAILURE, \"pkey_free\");\n"
337 "\\&\n"
338 " exit(EXIT_SUCCESS);\n"
339 "}\n"
340 msgstr ""
341
342 #. type: SH
343 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
344 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
345 #, no-wrap
346 msgid "SEE ALSO"
347 msgstr ""
348
349 #. type: Plain text
350 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
351 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
352 msgid "B<pkey_alloc>(2), B<pkey_free>(2), B<pkey_mprotect>(2), B<sigaction>(2)"
353 msgstr ""
354
355 #. type: TH
356 #: debian-trixie fedora-44 fedora-rawhide
357 #, no-wrap
358 msgid "2024-06-15"
359 msgstr ""
360
361 #. type: TH
362 #: debian-trixie
363 #, no-wrap
364 msgid "Linux man-pages 6.9.1"
365 msgstr ""
366
367 #. type: TH
368 #: fedora-44 fedora-rawhide
369 #, no-wrap
370 msgid "Linux man-pages 6.13"
371 msgstr ""
372
373 #. type: TH
374 #: mageia-cauldron
375 #, no-wrap
376 msgid "Linux man-pages 6.17"
377 msgstr ""
378
379 #. type: TH
380 #: opensuse-leap-16-1 opensuse-tumbleweed
381 #, no-wrap
382 msgid "Linux man-pages (unreleased)"
383 msgstr ""