| 1 |
# Russian translation of manpages |
| 2 |
# This file is distributed under the same license as the manpages-l10n package. |
| 3 |
# Copyright © of this file: |
| 4 |
# Alexey, 2016. |
| 5 |
# Azamat Hackimov <[email protected]>, 2014-2017. |
| 6 |
# kogamatranslator49 <[email protected]>, 2015. |
| 7 |
# Darima Kogan <[email protected]>, 2014. |
| 8 |
# Max Is <[email protected]>, 2016. |
| 9 |
# Yuri Kozlov <[email protected]>, 2011-2019. |
| 10 |
# Иван Павлов <[email protected]>, 2017. |
| 11 |
msgid "" |
| 12 |
msgstr "" |
| 13 |
"Project-Id-Version: manpages-l10n\n" |
| 14 |
"POT-Creation-Date: 2026-06-05 06:35+0200\n" |
| 15 |
"PO-Revision-Date: 2024-12-21 19:50+0300\n" |
| 16 |
"Last-Translator: Yuri Kozlov <[email protected]>\n" |
| 17 |
"Language-Team: Russian <[email protected]>\n" |
| 18 |
"Language: ru\n" |
| 19 |
"MIME-Version: 1.0\n" |
| 20 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 21 |
"Content-Transfer-Encoding: 8bit\n" |
| 22 |
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " |
| 23 |
"n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || " |
| 24 |
"(n%100>=11 && n%100<=14)? 2 : 3);\n" |
| 25 |
"X-Generator: Lokalize 2.0\n" |
| 26 |
|
| 27 |
#. type: TH |
| 28 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 29 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 30 |
#, no-wrap |
| 31 |
msgid "pkeys" |
| 32 |
msgstr "pkeys" |
| 33 |
|
| 34 |
#. type: TH |
| 35 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 36 |
#: opensuse-tumbleweed |
| 37 |
#, no-wrap |
| 38 |
msgid "2026-02-08" |
| 39 |
msgstr "8 февраля 2026 г." |
| 40 |
|
| 41 |
#. type: TH |
| 42 |
#: archlinux debian-unstable |
| 43 |
#, fuzzy, no-wrap |
| 44 |
#| msgid "Linux man-pages 6.17" |
| 45 |
msgid "Linux man-pages 6.18" |
| 46 |
msgstr "Справочные страницы Linux 6.17" |
| 47 |
|
| 48 |
#. type: SH |
| 49 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 50 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 51 |
#, no-wrap |
| 52 |
msgid "NAME" |
| 53 |
msgstr "НАИМЕНОВАНИЕ" |
| 54 |
|
| 55 |
#. type: Plain text |
| 56 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 57 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 58 |
msgid "pkeys - overview of Memory Protection Keys" |
| 59 |
msgstr "pkeys - обзор ключей защиты памяти" |
| 60 |
|
| 61 |
#. type: SH |
| 62 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 63 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 64 |
#, no-wrap |
| 65 |
msgid "DESCRIPTION" |
| 66 |
msgstr "ОПИСАНИЕ" |
| 67 |
|
| 68 |
#. type: Plain text |
| 69 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 70 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 71 |
msgid "" |
| 72 |
"Memory Protection Keys (pkeys) are an extension to existing page-based " |
| 73 |
"memory permissions. Normal page permissions using page tables require " |
| 74 |
"expensive system calls and TLB invalidations when changing permissions. " |
| 75 |
"Memory Protection Keys provide a mechanism for changing protections without " |
| 76 |
"requiring modification of the page tables on every permission change." |
| 77 |
msgstr "" |
| 78 |
"Ключи защиты памяти (pkeys) — это расширение существующих постраничных прав " |
| 79 |
"на память. Для обычных прав на страницу используются страничные таблицы, " |
| 80 |
"требующие для изменении прав затратных системных вызовов и аннулирования " |
| 81 |
"TLB. Ключи защиты памяти предоставляют механизм изменения защиты без " |
| 82 |
"необходимости изменять страничные таблицы при каждом изменении прав." |
| 83 |
|
| 84 |
#. type: Plain text |
| 85 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 86 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 87 |
msgid "" |
| 88 |
"To use pkeys, software must first \"tag\" a page in the page tables with a " |
| 89 |
"pkey. After this tag is in place, an application only has to change the " |
| 90 |
"contents of a register in order to remove write access, or all access to a " |
| 91 |
"tagged page." |
| 92 |
msgstr "" |
| 93 |
"Чтобы использовать pkeys, ПО сначала должно «пометить» (tag) страницу в " |
| 94 |
"страничных таблицах значением pkey. После размещения этой метки для удаления " |
| 95 |
"прав на запись или весь доступ к помеченной странице приложению нужно " |
| 96 |
"изменить только содержимое регистра." |
| 97 |
|
| 98 |
#. type: Plain text |
| 99 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 100 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 101 |
msgid "" |
| 102 |
"Protection keys work in conjunction with the existing B<PROT_READ>, " |
| 103 |
"B<PROT_WRITE>, and B<PROT_EXEC> permissions passed to system calls such as " |
| 104 |
"B<mprotect>(2) and B<mmap>(2), but always act to further restrict these " |
| 105 |
"traditional permission mechanisms." |
| 106 |
msgstr "" |
| 107 |
"Ключи защиты вместе с существующими правами B<PROT_READ>, B<PROT_WRITE> и " |
| 108 |
"B<PROT_EXEC> передаются в системные вызовы, такие как B<mprotect>(2) и " |
| 109 |
"B<mmap>(2), но всегда считаются как дополнительное ограничение к " |
| 110 |
"существующим традиционным механизмам прав доступа." |
| 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 |
"If a process performs an access that violates pkey restrictions, it receives " |
| 117 |
"a B<SIGSEGV> signal. See B<sigaction>(2) for details of the information " |
| 118 |
"available with that signal." |
| 119 |
msgstr "" |
| 120 |
"Если процесс осуществляет доступ, нарушающий ограничения pkey, то он " |
| 121 |
"получает сигнал B<SIGSEGV>. Подробную информацию об этом сигнале смотрите в " |
| 122 |
"B<sigaction>(2)." |
| 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 "" |
| 128 |
"To use the pkeys feature, the processor must support it, and the kernel must " |
| 129 |
"contain support for the feature on a given processor. As of early 2016 only " |
| 130 |
"future Intel x86 processors are supported, and this hardware supports 16 " |
| 131 |
"protection keys in each process. However, pkey 0 is used as the default " |
| 132 |
"key, so a maximum of 15 are available for actual application use. The " |
| 133 |
"default key is assigned to any memory region for which a pkey has not been " |
| 134 |
"explicitly assigned via B<pkey_mprotect>(2)." |
| 135 |
msgstr "" |
| 136 |
"Чтобы использовать свойство pkeys, это должен поддерживать процессор, а ядро " |
| 137 |
"должно включать поддержку этого свойства для этого процессора. К началу " |
| 138 |
"2016 года это относится только к будущим процессорам Intel x86, и данная " |
| 139 |
"аппаратура поддерживает 16 ключей защиты на каждый процесс. Однако pkey 0 " |
| 140 |
"используется как ключ по умолчанию, поэтому для приложения доступно только " |
| 141 |
"15. Ключ по умолчанию назначается любой области памяти, для которой pkey не " |
| 142 |
"был назначен явным образом с помощью B<pkey_mprotect>(2)." |
| 143 |
|
| 144 |
#. type: Plain text |
| 145 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 146 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 147 |
msgid "" |
| 148 |
"Protection keys have the potential to add a layer of security and " |
| 149 |
"reliability to applications. But they have not been primarily designed as a " |
| 150 |
"security feature. For instance, WRPKRU is a completely unprivileged " |
| 151 |
"instruction, so pkeys are useless in any case that an attacker controls the " |
| 152 |
"PKRU register or can execute arbitrary instructions." |
| 153 |
msgstr "" |
| 154 |
"Потенциально, ключи защиты могут добавить уровень безопасности и надежности " |
| 155 |
"приложений. Но, прежде всего, они не разрабатывались как средство защиты. " |
| 156 |
"Например, WRPKRU — это полностью непривилегированная инструкция, поэтому " |
| 157 |
"pkeys бесполезны, когда атакующий контролирует регистр PKRU или может " |
| 158 |
"выполнять любые инструкции." |
| 159 |
|
| 160 |
#. type: Plain text |
| 161 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 162 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 163 |
msgid "" |
| 164 |
"Applications should be very careful to ensure that they do not \"leak\" " |
| 165 |
"protection keys. For instance, before calling B<pkey_free>(2), the " |
| 166 |
"application should be sure that no memory has that pkey assigned. If the " |
| 167 |
"application left the freed pkey assigned, a future user of that pkey might " |
| 168 |
"inadvertently change the permissions of an unrelated data structure, which " |
| 169 |
"could impact security or stability. The kernel currently allows in-use " |
| 170 |
"pkeys to have B<pkey_free>(2) called on them because it would have " |
| 171 |
"processor or memory performance implications to perform the additional " |
| 172 |
"checks needed to disallow it. Implementation of the necessary checks is " |
| 173 |
"left up to applications. Applications may implement these checks by " |
| 174 |
"searching the I</proc/>pidI</smaps> file for memory regions with the pkey " |
| 175 |
"assigned. Further details can be found in B<proc>(5)." |
| 176 |
msgstr "" |
| 177 |
"Приложения должны следить за тем, чтобы их ключи защиты не «не утекли». " |
| 178 |
"Например, перед вызовом B<pkey_free>(2) приложение должно проверить, что " |
| 179 |
"pkey не назначен памяти. Если приложение оставит назначенным освобождённый " |
| 180 |
"pkey, то будущий пользователь этого pkey может непреднамеренно изменить " |
| 181 |
"права на не относящуюся к делу структуру данных, что может привести к " |
| 182 |
"проблемам с безопасностью или стабильностью. В настоящее время ядро " |
| 183 |
"позволяет вызывать B<pkey_free>(2) для задействованных pkeys, так как " |
| 184 |
"выполнение дополнительных проверок повлияло бы на производительность " |
| 185 |
"процессора или памяти. Реализация необходимых проверок переложена на " |
| 186 |
"приложение. Приложения могут найти области памяти, которым назначен pkey, в " |
| 187 |
"файле I</proc/>pidI</smaps>. Дополнительная информация представлена в " |
| 188 |
"B<proc>(5)." |
| 189 |
|
| 190 |
#. type: Plain text |
| 191 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 192 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 193 |
msgid "" |
| 194 |
"Any application wanting to use protection keys needs to be able to function " |
| 195 |
"without them. They might be unavailable because the hardware that the " |
| 196 |
"application runs on does not support them, the kernel code does not contain " |
| 197 |
"support, the kernel support has been disabled, or because the keys have all " |
| 198 |
"been allocated, perhaps by a library the application is using. It is " |
| 199 |
"recommended that applications wanting to use protection keys should simply " |
| 200 |
"call B<pkey_alloc>(2) and test whether the call succeeds, instead of " |
| 201 |
"attempting to detect support for the feature in any other way." |
| 202 |
msgstr "" |
| 203 |
"Приложение, которое хочет воспользоваться ключами защиты, может работать и " |
| 204 |
"без них. Ключи могут быть недоступны из-за отсутствия аппаратной поддержки " |
| 205 |
"системе, где запускается приложение, в коде ядра может не быть поддержки, " |
| 206 |
"поддержка в ядре может быть выключена или все ключи уже задействованы " |
| 207 |
"библиотекой, которую использует приложение. В приложениях рекомендуется " |
| 208 |
"просто вызывать B<pkey_alloc>(2) и проверять успешность выполнения, а не " |
| 209 |
"пытаться проверять наличие поддержки каким-то другим образом." |
| 210 |
|
| 211 |
#. type: Plain text |
| 212 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 213 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 214 |
msgid "" |
| 215 |
"Although unnecessary, hardware support for protection keys may be enumerated " |
| 216 |
"with the I<cpuid> instruction. Details of how to do this can be found in " |
| 217 |
"the Intel Software Developers Manual. The kernel performs this enumeration " |
| 218 |
"and exposes the information in I</proc/cpuinfo> under the \"flags\" field. " |
| 219 |
"The string \"pku\" in this field indicates hardware support for protection " |
| 220 |
"keys and the string \"ospke\" indicates that the kernel contains and has " |
| 221 |
"enabled protection keys support." |
| 222 |
msgstr "" |
| 223 |
"Хотя и необязательно, поддержку ключей защиты в аппаратуре можно определить " |
| 224 |
"помощью инструкции I<cpuid>. От том, как это сделать, смотрите в программном " |
| 225 |
"руководстве разработчика Intel. Ядро определяет наличие поддержки и выводит " |
| 226 |
"информацию в I</proc/cpuinfo> в поле «flags». Строка «pku» в этом поле " |
| 227 |
"означает, что аппаратура поддерживает ключи защиты, а строка «ospke» " |
| 228 |
"означает, что ядро содержит включённую поддержку защиты." |
| 229 |
|
| 230 |
#. type: Plain text |
| 231 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 232 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 233 |
msgid "" |
| 234 |
"Applications using threads and protection keys should be especially " |
| 235 |
"careful. Threads inherit the protection key rights of the parent at the " |
| 236 |
"time of the B<clone>(2), system call. Applications should either ensure " |
| 237 |
"that their own permissions are appropriate for child threads at the time " |
| 238 |
"when B<clone>(2) is called, or ensure that each child thread can perform " |
| 239 |
"its own initialization of protection key rights." |
| 240 |
msgstr "" |
| 241 |
"Если приложение использует нити и ключи защиты, то нужно быть особенно " |
| 242 |
"осторожным. Нити наследуют права ключей защиты родителя при выполнении " |
| 243 |
"системного вызова B<clone>(2). Приложения должны убедиться, что их " |
| 244 |
"собственные права подходят для дочерних нитей до вызова B<clone>(2) или " |
| 245 |
"выполнять инициализацию прав ключей защиты в самих нитях." |
| 246 |
|
| 247 |
#. type: SS |
| 248 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 249 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 250 |
#, no-wrap |
| 251 |
msgid "Signal Handler Behavior" |
| 252 |
msgstr "Поведение обработчика сигналов" |
| 253 |
|
| 254 |
#. type: Plain text |
| 255 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 256 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 257 |
msgid "" |
| 258 |
"Each time a signal handler is invoked (including nested signals), the thread " |
| 259 |
"is temporarily given a new, default set of protection key rights that " |
| 260 |
"override the rights from the interrupted context. This means that " |
| 261 |
"applications must re-establish their desired protection key rights upon " |
| 262 |
"entering a signal handler if the desired rights differ from the defaults. " |
| 263 |
"The rights of any interrupted context are restored when the signal handler " |
| 264 |
"returns." |
| 265 |
msgstr "" |
| 266 |
"Каждый раз, когда вызывается обработчик сигнала (включая вложенные сигналы), " |
| 267 |
"нити временно даётся новый набор прав ключа защиты по умолчанию, который " |
| 268 |
"заменяет права прерванного контекста. Это означает, что приложения должны " |
| 269 |
"переустанавливать свои желаемые права ключа защиты при входе в обработчик " |
| 270 |
"сигнала, если желаемые права отличаются от значения по умолчанию. Права " |
| 271 |
"любого прерванного контекста восстанавливаются при завершении обработчика " |
| 272 |
"сигналов." |
| 273 |
|
| 274 |
#. type: Plain text |
| 275 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 276 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 277 |
msgid "" |
| 278 |
"This signal behavior is unusual and is due to the fact that the x86 PKRU " |
| 279 |
"register (which stores protection key access rights) is managed with the " |
| 280 |
"same hardware mechanism (XSAVE) that manages floating-point registers. The " |
| 281 |
"signal behavior is the same as that of floating-point registers." |
| 282 |
msgstr "" |
| 283 |
"Данное поведение сигнала необычно из-за того, что регистр x86 PKRU (который " |
| 284 |
"хранит права доступа ключа защиты) управляется тем же аппаратным механизмом " |
| 285 |
"(XSAVE) что и регистры плавающей запятой. Поведение сигнала такое же как у " |
| 286 |
"регистров плавающей запятой." |
| 287 |
|
| 288 |
#. type: SS |
| 289 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 290 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 291 |
#, no-wrap |
| 292 |
msgid "Protection Keys system calls" |
| 293 |
msgstr "Системные вызовы ключей защиты" |
| 294 |
|
| 295 |
#. type: Plain text |
| 296 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 297 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 298 |
msgid "" |
| 299 |
"The Linux kernel implements the following pkey-related system calls: " |
| 300 |
"B<pkey_mprotect>(2), B<pkey_alloc>(2), and B<pkey_free>(2)." |
| 301 |
msgstr "" |
| 302 |
"В ядре Linux реализованы следующие системные вызовы для работы с pkey: " |
| 303 |
"B<pkey_mprotect>(2), B<pkey_alloc>(2) и B<pkey_free>(2)." |
| 304 |
|
| 305 |
#. type: Plain text |
| 306 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 307 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 308 |
msgid "" |
| 309 |
"The Linux pkey system calls are available only if the kernel was configured " |
| 310 |
"and built with the B<CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS> option." |
| 311 |
msgstr "" |
| 312 |
"Системные вызовы Linux pkey доступны только, если ядро было собрано с " |
| 313 |
"включённым параметром B<CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS>." |
| 314 |
|
| 315 |
#. type: SH |
| 316 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 317 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 318 |
#, no-wrap |
| 319 |
msgid "EXAMPLES" |
| 320 |
msgstr "ПРИМЕРЫ" |
| 321 |
|
| 322 |
#. type: Plain text |
| 323 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 324 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 325 |
msgid "" |
| 326 |
"The program below allocates a page of memory with read and write " |
| 327 |
"permissions. It then writes some data to the memory and successfully reads " |
| 328 |
"it back. After that, it attempts to allocate a protection key and disallows " |
| 329 |
"access to the page by using the WRPKRU instruction. It then tries to access " |
| 330 |
"the page, which we now expect to cause a fatal signal to the application." |
| 331 |
msgstr "" |
| 332 |
"Программа, представленная далее, выделяет страницу памяти с правами на " |
| 333 |
"чтение и запись. Затем она записывает кусок данных в памяти и читает его. " |
| 334 |
"После этого она пытается выделить ключ защиты и запретить доступ к странице " |
| 335 |
"с помощью инструкции WRPKRU. Далее она пытается получить доступ к странице, " |
| 336 |
"что, как мы ожидаем, вызовет сигнал завершения приложения." |
| 337 |
|
| 338 |
#. type: Plain text |
| 339 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 340 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 341 |
#, no-wrap |
| 342 |
msgid "" |
| 343 |
"$B< ./a.out>\n" |
| 344 |
"buffer contains: 73\n" |
| 345 |
"about to read buffer again...\n" |
| 346 |
"Segmentation fault (core dumped)\n" |
| 347 |
msgstr "" |
| 348 |
"$B< ./a.out>\n" |
| 349 |
"буфер содержит: 73\n" |
| 350 |
"читаем буфер снова...\n" |
| 351 |
"Segmentation fault (core dumped)\n" |
| 352 |
|
| 353 |
#. type: SS |
| 354 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 355 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 356 |
#, no-wrap |
| 357 |
msgid "Program source" |
| 358 |
msgstr "Исходный код программы" |
| 359 |
|
| 360 |
#. type: Plain text |
| 361 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 362 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 363 |
#, no-wrap |
| 364 |
msgid "" |
| 365 |
"#define _GNU_SOURCE\n" |
| 366 |
"#include E<lt>err.hE<gt>\n" |
| 367 |
"#include E<lt>unistd.hE<gt>\n" |
| 368 |
"#include E<lt>stdio.hE<gt>\n" |
| 369 |
"#include E<lt>stdlib.hE<gt>\n" |
| 370 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 371 |
"\\&\n" |
| 372 |
"int\n" |
| 373 |
"main(void)\n" |
| 374 |
"{\n" |
| 375 |
" int status;\n" |
| 376 |
" int pkey;\n" |
| 377 |
" int *buffer;\n" |
| 378 |
"\\&\n" |
| 379 |
" /*\n" |
| 380 |
" * Allocate one page of memory.\n" |
| 381 |
" */\n" |
| 382 |
" buffer = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE,\n" |
| 383 |
" MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);\n" |
| 384 |
" if (buffer == MAP_FAILED)\n" |
| 385 |
" err(EXIT_FAILURE, \"mmap\");\n" |
| 386 |
"\\&\n" |
| 387 |
" /*\n" |
| 388 |
" * Put some random data into the page (still OK to touch).\n" |
| 389 |
" */\n" |
| 390 |
" *buffer = __LINE__;\n" |
| 391 |
" printf(\"buffer contains: %d\\[rs]n\", *buffer);\n" |
| 392 |
"\\&\n" |
| 393 |
" /*\n" |
| 394 |
" * Allocate a protection key:\n" |
| 395 |
" */\n" |
| 396 |
" pkey = pkey_alloc(0, 0);\n" |
| 397 |
" if (pkey == -1)\n" |
| 398 |
" err(EXIT_FAILURE, \"pkey_alloc\");\n" |
| 399 |
"\\&\n" |
| 400 |
" /*\n" |
| 401 |
" * Disable access to any memory with \"pkey\" set,\n" |
| 402 |
" * even though there is none right now.\n" |
| 403 |
" */\n" |
| 404 |
" status = pkey_set(pkey, PKEY_DISABLE_ACCESS);\n" |
| 405 |
" if (status)\n" |
| 406 |
" err(EXIT_FAILURE, \"pkey_set\");\n" |
| 407 |
"\\&\n" |
| 408 |
" /*\n" |
| 409 |
" * Set the protection key on \"buffer\".\n" |
| 410 |
" * Note that it is still read/write as far as mprotect() is\n" |
| 411 |
" * concerned and the previous pkey_set() overrides it.\n" |
| 412 |
" */\n" |
| 413 |
" status = pkey_mprotect(buffer, getpagesize(),\n" |
| 414 |
" PROT_READ | PROT_WRITE, pkey);\n" |
| 415 |
" if (status == -1)\n" |
| 416 |
" err(EXIT_FAILURE, \"pkey_mprotect\");\n" |
| 417 |
"\\&\n" |
| 418 |
" printf(\"about to read buffer again...\\[rs]n\");\n" |
| 419 |
"\\&\n" |
| 420 |
" /*\n" |
| 421 |
" * This will crash, because we have disallowed access.\n" |
| 422 |
" */\n" |
| 423 |
" printf(\"buffer contains: %d\\[rs]n\", *buffer);\n" |
| 424 |
"\\&\n" |
| 425 |
" status = pkey_free(pkey);\n" |
| 426 |
" if (status == -1)\n" |
| 427 |
" err(EXIT_FAILURE, \"pkey_free\");\n" |
| 428 |
"\\&\n" |
| 429 |
" exit(EXIT_SUCCESS);\n" |
| 430 |
"}\n" |
| 431 |
msgstr "" |
| 432 |
|
| 433 |
#. type: SH |
| 434 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 435 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 436 |
#, no-wrap |
| 437 |
msgid "SEE ALSO" |
| 438 |
msgstr "СМОТРИТЕ ТАКЖЕ" |
| 439 |
|
| 440 |
#. type: Plain text |
| 441 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 442 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 443 |
msgid "B<pkey_alloc>(2), B<pkey_free>(2), B<pkey_mprotect>(2), B<sigaction>(2)" |
| 444 |
msgstr "" |
| 445 |
"B<pkey_alloc>(2), B<pkey_free>(2), B<pkey_mprotect>(2), B<sigaction>(2)" |
| 446 |
|
| 447 |
#. type: TH |
| 448 |
#: debian-trixie fedora-44 fedora-rawhide |
| 449 |
#, no-wrap |
| 450 |
msgid "2024-06-15" |
| 451 |
msgstr "15 июня 2024 г." |
| 452 |
|
| 453 |
#. type: TH |
| 454 |
#: debian-trixie |
| 455 |
#, no-wrap |
| 456 |
msgid "Linux man-pages 6.9.1" |
| 457 |
msgstr "Страницы руководства Linux 6.9.1" |
| 458 |
|
| 459 |
#. type: TH |
| 460 |
#: fedora-44 fedora-rawhide |
| 461 |
#, no-wrap |
| 462 |
msgid "Linux man-pages 6.13" |
| 463 |
msgstr "Страницы руководства Linux 6.13" |
| 464 |
|
| 465 |
#. type: TH |
| 466 |
#: mageia-cauldron |
| 467 |
#, no-wrap |
| 468 |
msgid "Linux man-pages 6.17" |
| 469 |
msgstr "Страницы руководства Linux 6.17" |
| 470 |
|
| 471 |
#. type: TH |
| 472 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 473 |
#, no-wrap |
| 474 |
msgid "Linux man-pages (unreleased)" |
| 475 |
msgstr "Страницы руководства Linux (не выпущены)" |