OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man7 / capabilities.7
1 .\" Copyright (c) 2002 by Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" 6 Aug 2002 - Initial Creation
24 .\" Modified 2003-05-23, Michael Kerrisk, <mtk.manpages@gmail.com>
25 .\" Modified 2004-05-27, Michael Kerrisk, <mtk.manpages@gmail.com>
26 .\" 2004-12-08, mtk Added O_NOATIME for CAP_FOWNER
27 .\" 2005-08-16, mtk, Added CAP_AUDIT_CONTROL and CAP_AUDIT_WRITE
28 .\" 2008-07-15, Serge Hallyn <serue@us.bbm.com>
29 .\"     Document file capabilities, per-process capability
30 .\"     bounding set, changed semantics for CAP_SETPCAP,
31 .\"     and other changes in 2.6.2[45].
32 .\"     Add CAP_MAC_ADMIN, CAP_MAC_OVERRIDE, CAP_SETFCAP.
33 .\" 2008-07-15, mtk
34 .\"     Add text describing circumstances in which CAP_SETPCAP
35 .\"     (theoretically) permits a thread to change the
36 .\"     capability sets of another thread.
37 .\"     Add section describing rules for programmatically
38 .\"     adjusting thread capability sets.
39 .\"     Describe rationale for capability bounding set.
40 .\"     Document "securebits" flags.
41 .\"     Add text noting that if we set the effective flag for one file
42 .\"     capability, then we must also set the effective flag for all
43 .\"     other capabilities where the permitted or inheritable bit is set.
44 .\"
45 .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved.
46 .\" Translated 2005-03-09, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
47 .\" Updated 2005-11-04, Akihiro MOTOKI
48 .\" Updated 2006-04-16, Akihiro MOTOKI, LDP v2.29
49 .\" Updated 2006-07-20, Akihiro MOTOKI, LDP v2.34
50 .\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43
51 .\" Updated 2008-12-24, Akihiro MOTOKI, LDP v3.15
52 .\" Updated 2009-02-27, Akihiro MOTOKI, LDP v3.19
53 .\" Updated 2010-04-11, Akihiro MOTOKI, LDP v3.24
54 .\"
55 .TH CAPABILITIES 7 2010-06-19 "Linux" "Linux Programmer's Manual"
56 .\"O .SH NAME
57 .SH 名前
58 .\"O capabilities \- overview of Linux capabilities
59 capabilities \- Linux のケーパビリティ (capability) の概要
60 .\"O .SH DESCRIPTION
61 .SH 説明
62 .\"O For the purpose of performing permission checks,
63 .\"O traditional UNIX implementations distinguish two categories of processes:
64 .\"O .I privileged
65 .\"O processes (whose effective user ID is 0, referred to as superuser or root),
66 .\"O and
67 .\"O .I unprivileged
68 .\"O processes (whose effective UID is nonzero).
69 権限のチェックを行う観点から見ると、伝統的な UNIX の実装では
70 プロセスは二つのカテゴリに分類できる:
71 .I 特権
72 プロセス (実効ユーザID が 0 のプロセス。ユーザID 0 は
73 スーパーユーザや root と呼ばれる) と
74 .I 非特権
75 プロセス (実効ユーザID が 0 以外のプロセス) である。
76 .\"O Privileged processes bypass all kernel permission checks,
77 .\"O while unprivileged processes are subject to full permission
78 .\"O checking based on the process's credentials
79 .\"O (usually: effective UID, effective GID, and supplementary group list).
80 非特権プロセスでは、プロセスの資格情報 (通常は、実効UID 、実効GID
81 と追加のグループリスト) に基づく権限チェックが行われるのに対し、
82 特権プロセスでは全てのカーネルの権限チェックがバイパスされる。
83
84 .\"O Starting with kernel 2.2, Linux divides the privileges traditionally
85 .\"O associated with superuser into distinct units, known as
86 .\"O .IR capabilities ,
87 .\"O which can be independently enabled and disabled.
88 .\"O Capabilities are a per-thread attribute.
89 バージョン 2.2 以降の Linux では、
90 これまでスーパーユーザに結び付けられてきた権限を、
91 いくつかのグループに分割している。これらのグループは
92 .IR ケーパビリティ (capability)
93 と呼ばれ、グループ毎に独立に有効、無効を設定できる。
94 ケーパビリティはスレッド単位の属性である。
95 .\"
96 .\"O .SS Capabilities List
97 .SS ケーパビリティのリスト
98 .\"O The following list shows the capabilities implemented on Linux,
99 .\"O and the operations or behaviors that each capability permits:
100 以下のリストは、
101 Linux で実装されているケーパビリティと
102 各ケーパビリティが許可する操作と動作をまとめたものである。
103 .TP
104 .\"O .BR CAP_AUDIT_CONTROL " (since Linux 2.6.11)"
105 .\"O Enable and disable kernel auditing; change auditing filter rules;
106 .\"O retrieve auditing status and filtering rules.
107 .BR CAP_AUDIT_CONTROL " (Linux 2.6.11 以降)"
108 カーネル監査 (audit) の有効無効の切り替え、
109 監査のフィルタ・ルールの変更、
110 監査の状況やフィルタ・ルールの取得ができる。
111 .TP
112 .\"O .BR CAP_AUDIT_WRITE " (since Linux 2.6.11)"
113 .BR CAP_AUDIT_WRITE " (Linux 2.6.11 以降)"
114 .\"O Write records to kernel auditing log.
115 カーネル監査のログにレコードを書き込む。
116 .TP
117 .B CAP_CHOWN
118 .\"O Make arbitrary changes to file UIDs and GIDs (see
119 .\"O .BR chown (2)).
120 ファイルの UID とGID を任意に変更する
121 .RB ( chown (2)
122 参照)。
123 .TP
124 .B CAP_DAC_OVERRIDE
125 .\"O Bypass file read, write, and execute permission checks.
126 .\"O (DAC is an abbreviation of "discretionary access control".)
127 ファイルの読み出し、書き込み、実行の権限チェックをバイパスする
128 (DAC は "discretionary access control (任意のアクセス制御)" の略である)。
129 .TP
130 .B CAP_DAC_READ_SEARCH
131 .\"O Bypass file read permission checks and
132 .\"O directory read and execute permission checks.
133 ファイルの読み出し権限のチェックとディレクトリの読み出しと実行
134 の権限チェックをバイパスする。
135 .TP
136 .B CAP_FOWNER
137 .PD 0
138 .RS
139 .IP * 2
140 .\"O Bypass permission checks on operations that normally
141 .\"O require the file system UID of the process to match the UID of
142 .\"O the file (e.g.,
143 .\"O .BR chmod (2),
144 .\"O .BR utime (2)),
145 .\"O excluding those operations covered by
146 .\"O .B CAP_DAC_OVERRIDE
147 .\"O and
148 .\"O .BR CAP_DAC_READ_SEARCH ;
149 通常、プロセスのファイルシステム UID がファイルの UID に一致することが
150 要求される操作 (例えば
151 .BR chmod (2),
152 .BR utime (2))
153 における権限チェックをバイパスする。
154 但し、
155 .B CAP_DAC_OVERRIDE
156
157 .B CAP_DAC_READ_SEARCH
158 によりチェックが行われる操作は除く。
159 .IP *
160 .\"O set extended file attributes (see
161 .\"O .BR chattr (1))
162 .\"O on arbitrary files;
163 任意のファイルに対して拡張ファイル属性を設定する
164 .RB ( chattr (1)
165 参照)。
166 .IP *
167 .\"O set Access Control Lists (ACLs) on arbitrary files;
168 任意のファイルに対してアクセス制御リスト (ACL) を設定する。
169 .IP *
170 .\"O ignore directory sticky bit on file deletion;
171 ファイルの削除の際にディレクトリのスティッキービットを無視する。
172 .IP *
173 .\"O specify
174 .\"O .B O_NOATIME
175 .\"O for arbitrary files in
176 .\"O .BR open (2)
177 .\"O and
178 .\"O .BR fcntl (2).
179 .BR open (2)
180
181 .BR fcntl (2)
182 で任意のファイルに対して
183 .B O_NOATIME
184 を指定する。
185 .RE
186 .PD
187 .TP
188 .B CAP_FSETID
189 .\"O Don't clear set-user-ID and set-group-ID permission
190 .\"O bits when a file is modified;
191 .\"O set the set-group-ID bit for a file whose GID does not match
192 .\"O the file system or any of the supplementary GIDs of the calling process.
193 ファイルが変更されたときに set-user-ID とset-group-ID の許可ビットをクリア
194 しない。呼び出し元プロセスのファイルシステム GID と追加の GID のいずれとも
195 GID が一致しないファイルに対して set-group-ID ビットを設定する。
196 .TP
197 .B CAP_IPC_LOCK
198 .\"O Lock memory
199 .\"O .RB ( mlock (2),
200 .\"O .BR mlockall (2),
201 .\"O .BR mmap (2),
202 .\"O .BR shmctl (2)).
203 メモリーのロック
204 .RB ( mlock (2),
205 .BR mlockall (2),
206 .BR mmap (2),
207 .BR shmctl (2))
208 を行う。
209 .TP
210 .B CAP_IPC_OWNER
211 .\"O Bypass permission checks for operations on System V IPC objects.
212 System V IPC オブジェクトに対する操作に関して権限チェックをバイパスする。
213 .TP
214 .B CAP_KILL
215 .\"O Bypass permission checks for sending signals (see
216 .\"O .BR kill (2)).
217 .\"O This includes use of the
218 .\"O .BR ioctl (2)
219 .\"O .B KDSIGACCEPT
220 .\"O operation.
221 シグナルを送信する際に権限チェックをバイパスする
222 .RB ( kill (2)
223 参照)。これには
224 .BR ioctl (2)
225
226 .B KDSIGACCEPT
227 操作の使用も含まれる。
228 .\" FIXME CAP_KILL also has an effect for threads + setting child
229 .\"       termination signal to other than SIGCHLD: without this
230 .\"       capability, the termination signal reverts to SIGCHLD
231 .\"       if the child does an exec().  What is the rationale
232 .\"       for this?
233 .TP
234 .\"O .BR CAP_LEASE " (since Linux 2.4)"
235 .BR CAP_LEASE " (Linux 2.4 以降)"
236 .\"O Establish leases on arbitrary files (see
237 .\"O .BR fcntl (2)).
238 任意のファイルに対して
239 ファイルリースを設定する
240 .RB ( fcntl (2)
241 参照)。
242 .TP
243 .B CAP_LINUX_IMMUTABLE
244 .\"O Set the
245 .\"O .B FS_APPEND_FL
246 .\"O and
247 .\"O .B FS_IMMUTABLE_FL
248 .\"O .\" These attributes are now available on ext2, ext3, Reiserfs, XFS, JFS
249 .\"O i-node flags (see
250 .\"O .BR chattr (1)).
251 拡張ファイル属性
252 .B FS_APPEND_FL
253
254 .B FS_IMMUTABLE_FL
255 を設定する
256 .RB ( chattr (1)
257 参照)。
258 .\" これらの属性は ext2, ext3, Reiserfs, XFS, JFS で利用可能である。
259 .TP
260 .\"O .BR CAP_MAC_ADMIN " (since Linux 2.6.25)"
261 .BR CAP_MAC_ADMIN " (Linux 2.6.25 以降)"
262 .\"O Override Mandatory Access Control (MAC).
263 .\"O Implemented for the Smack Linux Security Module (LSM).
264 強制アクセス制御 (MAC) を上書きする。
265 Smack Linux Security Module (LSM) 用に実装されている。
266 .TP
267 .\"O .BR CAP_MAC_OVERRIDE " (since Linux 2.6.25)"
268 .BR CAP_MAC_OVERRIDE " (Linux 2.6.25 以降)"
269 .\"O Allow MAC configuration or state changes.
270 .\"O Implemented for the Smack LSM.
271 MAC の設定や状態を変更する。
272 Smack LSM 用に実装されている。
273 .TP
274 .\"O .BR CAP_MKNOD " (since Linux 2.4)"
275 .BR CAP_MKNOD " (Linux 2.4 以降)"
276 .\"O Create special files using
277 .\"O .BR mknod (2).
278 (Linux 2.4 以降)
279 .BR mknod (2)
280 を使用してスペシャル・ファイルを作成する。
281 .TP
282 .B CAP_NET_ADMIN
283 .\"O Perform various network-related operations
284 .\"O (e.g., setting privileged socket options,
285 .\"O enabling multicasting, interface configuration,
286 .\"O modifying routing tables).
287 各種のネットワーク関連の操作を実行する。
288 (例えば、特権が必要なソケットオプションを設定する、マルチキャストを有効にする、
289 インターフェースを設定する、ルーティングテーブルを変更するなど)
290 .TP
291 .B CAP_NET_BIND_SERVICE
292 .\"O Bind a socket to Internet domain privileged ports
293 .\"O (port numbers less than 1024).
294 インターネットドメインの特権ポート (ポート番号が 1024 番未満)
295 をバインドできる。
296 .TP
297 .B CAP_NET_BROADCAST
298 .\"O (Unused)  Make socket broadcasts, and listen to multicasts.
299 (未使用) ソケットのブロードキャストと、マルチキャストの待ち受けを行う。
300 .TP
301 .B CAP_NET_RAW
302 .\"O Use RAW and PACKET sockets.
303 .\"O .\" Also various IP options and setsockopt(SO_BINDTODEVICE)
304 RAW ソケットと PACKET ソケットを使用する。
305 .\" また、各種の IP オプションと SO_BINDTODEVICE ソケットオプションを使用できる。
306 .TP
307 .B CAP_SETGID
308 .\"O Make arbitrary manipulations of process GIDs and supplementary GID list;
309 .\"O forge GID when passing socket credentials via UNIX domain sockets.
310 プロセスの GID と追加の GID リストに対する任意の操作を行う。
311 UNIX ドメインソケット経由でソケットの資格情報 (credential) を渡す際に
312 偽の GID を渡すことができる。
313 .TP
314 .\"O .BR CAP_SETFCAP " (since Linux 2.6.24)"
315 .BR CAP_SETFCAP " (Linux 2.6.24 以降)"
316 .\"O Set file capabilities.
317 ファイルケーパビリティを設定する。
318 .TP
319 .B CAP_SETPCAP
320 .\"O If file capabilities are not supported:
321 .\"O grant or remove any capability in the
322 .\"O caller's permitted capability set to or from any other process.
323 .\"O (This property of
324 .\"O .B CAP_SETPCAP
325 .\"O is not available when the kernel is configured to support
326 .\"O file capabilities, since
327 .\"O .B CAP_SETPCAP
328 .\"O has entirely different semantics for such kernels.)
329 ファイルケーパビリティがサポートされていない場合:
330 呼び出し元が許可されているケーパビリティセットに含まれる任意のケーパビリティを、
331 他のプロセスに付与したり、削除したりできる。
332 (カーネルがファイルケーパビリティをサポートしている場合、
333 .B CAP_SETPCAP
334 はこの役割を持たない。
335 なぜなら、ファイルケーパビリティをサポートしているカーネルでは
336 .B CAP_SETPCAP
337 は全く別の意味を持つからである。)
338
339 .\"O If file capabilities are supported:
340 .\"O add any capability from the calling thread's bounding set
341 .\"O to its inheritable set;
342 .\"O drop capabilities from the bounding set (via
343 .\"O .BR prctl (2)
344 .\"O .BR PR_CAPBSET_DROP );
345 .\"O make changes to the
346 .\"O .I securebits
347 .\"O flags.
348 ファイルケーパビリティがサポートされている場合:
349 呼び出し元スレッドのバウンディングセットの任意のケーパビリティを
350 自身の継承可能ケーパビリティセットに追加できる。
351 .RB ( prctl (2)
352 .BR PR_CAPBSET_DROP
353 を使って)
354 バウンディングセットからケーパビリティを削除できる。
355 .I securebits
356 フラグを変更できる。
357 .TP
358 .B CAP_SETUID
359 .\"O Make arbitrary manipulations of process UIDs
360 .\"O .RB ( setuid (2),
361 .\"O .BR setreuid (2),
362 .\"O .BR setresuid (2),
363 .\"O .BR setfsuid (2));
364 .\"O make forged UID when passing socket credentials via UNIX domain sockets.
365 プロセスの UID に対する任意の操作
366 .RB ( setuid (2),
367 .BR setreuid (2),
368 .BR setresuid (2),
369 .BR setfsuid (2))
370 を行う。
371 UNIX ドメインソケット経由でソケットの資格情報 (credential) を渡す際に
372 偽の UID を渡すことができる。
373 .\" FIXME CAP_SETUID also an effect in exec(); document this.
374 .TP
375 .B CAP_SYS_ADMIN
376 .PD 0
377 .RS
378 .IP * 2
379 .\"O Perform a range of system administration operations including:
380 .\"O .BR quotactl (2),
381 .\"O .BR mount (2),
382 .\"O .BR umount (2),
383 .\"O .BR swapon (2),
384 .\"O .BR swapoff (2),
385 .\"O .BR sethostname (2),
386 .\"O and
387 .\"O .BR setdomainname (2);
388 以下のシステム管理用の操作を実行する:
389 .BR quotactl (2),
390 .BR mount (2),
391 .BR umount (2),
392 .BR swapon (2),
393 .BR swapoff (2),
394 .BR sethostname (2),
395 .BR setdomainname (2).
396 .IP *
397 .\"O perform
398 .\"O .B IPC_SET
399 .\"O and
400 .\"O .B IPC_RMID
401 .\"O operations on arbitrary System V IPC objects;
402 任意の System V IPC オブジェクトに対する
403 .B IPC_SET
404
405 .B IPC_RMID
406 操作を実行する。
407 .IP *
408 .\"O perform operations on
409 .\"O .I trusted
410 .\"O and
411 .\"O .I security
412 .\"O Extended Attributes (see
413 .\"O .BR attr (5));
414 拡張属性
415 .I trusted
416
417 .I security
418 に対する操作を実行する
419 .RB ( attr (5)
420 参照)。
421 .IP *
422 .\"O use
423 .\"O .BR lookup_dcookie (2);
424 .BR lookup_dcookie (2)
425 を呼び出す。
426 .IP *
427 .\"O use
428 .\"O .BR ioprio_set (2)
429 .\"O to assign
430 .\"O .B IOPRIO_CLASS_RT
431 .\"O and (before Linux 2.6.25)
432 .\"O .B IOPRIO_CLASS_IDLE
433 .\"O I/O scheduling classes;
434 .BR ioprio_set (2)
435 を使って I/O スケジューリングクラス
436 .BR IOPRIO_CLASS_RT ,
437 .B IOPRIO_CLASS_IDLE
438 を割り当てる
439 .RB ( IOPRIO_CLASS_IDLE
440 は Linux 2.6.25 より前のバージョンのみ)。
441 .IP *
442 .\"O forge UID when passing socket credentials;
443 ソケットの資格情報 (credential) を渡す際に偽の UID を渡す。
444 .IP *
445 .\"O exceed
446 .\"O .IR /proc/sys/fs/file-max ,
447 .\"O the system-wide limit on the number of open files,
448 .\"O in system calls that open files (e.g.,
449 .\"O .BR accept (2),
450 .\"O .BR execve (2),
451 .\"O .BR open (2),
452 .\"O .BR pipe (2));
453 ファイルをオープンするシステムコール (例えば
454 .BR accept (2),
455 .BR execve (2),
456 .BR open (2),
457 .BR pipe (2))
458 でシステム全体でオープンできるファイル数の上限
459 .I /proc/sys/fs/file-max
460 を超過する。
461 .IP *
462 .\"O employ
463 .\"O .B CLONE_NEWNS
464 .\"O flag with
465 .\"O .BR clone (2)
466 .\"O and
467 .\"O .BR unshare (2);
468 .BR clone (2)
469
470 .BR unshare (2)
471
472 .B CLONE_NEWNS
473 フラグを利用する。
474 .IP *
475 .\"O perform
476 .\"O .B KEYCTL_CHOWN
477 .\"O and
478 .\"O .B KEYCTL_SETPERM
479 .\"O .BR keyctl (2)
480 .\"O operations;
481 .BR keyctl (2)
482
483 .B KEYCTL_CHOWN
484
485 .B KEYCTL_SETPERM
486 操作を実行する。
487 .IP *
488 .\"O perform
489 .\"O .BR madvise (2)
490 .\"O .B MADV_HWPOISON
491 .\"O operation.
492 .BR madvise (2)
493
494 .B MADV_HWPOISON
495 操作を実行する。
496 .RE
497 .PD
498 .TP
499 .B CAP_SYS_BOOT
500 .\"O Use
501 .\"O .BR reboot (2)
502 .\"O and
503 .\"O .BR kexec_load (2).
504 .BR reboot (2)
505
506 .BR kexec_load (2)
507 を呼び出す。
508 .TP
509 .B CAP_SYS_CHROOT
510 .\"O Use
511 .\"O .BR chroot (2).
512 .BR chroot (2).
513 を呼び出す。
514 .TP
515 .B CAP_SYS_MODULE
516 .\"O Load and unload kernel modules
517 .\"O (see
518 .\"O .BR init_module (2)
519 .\"O and
520 .\"O .BR delete_module (2));
521 .\"O in kernels before 2.6.25:
522 .\"O drop capabilities from the system-wide capability bounding set.
523 カーネルモジュールのロード、アンロードを行う
524 .RB ( init_module (2)
525
526 .BR delete_module (2)
527 を参照のこと)。
528 バージョン 2.6.25 より前のカーネルで、
529 システム全体のケーパビリティバウンディングセット (capability bounding set)
530 からケーパビリティを外す。
531 .TP
532 .B CAP_SYS_NICE
533 .PD 0
534 .RS
535 .IP * 2
536 .\"O Raise process nice value
537 .\"O .RB ( nice (2),
538 .\"O .BR setpriority (2))
539 .\"O and change the nice value for arbitrary processes;
540 プロセスの nice 値の引き上げ
541 .RB ( nice (2),
542 .BR setpriority (2))
543 や、任意のプロセスの nice 値の変更を行う。
544 .IP *
545 .\"O set real-time scheduling policies for calling process,
546 .\"O and set scheduling policies and priorities for arbitrary processes
547 .\"O .RB ( sched_setscheduler (2),
548 .\"O .BR sched_setparam (2));
549 呼び出し元プロセスに対するリアルタイム・スケジューリングポリシーと、
550 任意のプロセスに対するスケジューリングポリシーと優先度を設定する
551 .RB ( sched_setscheduler (2),
552 .BR sched_setparam (2))。
553 .IP *
554 .\"O set CPU affinity for arbitrary processes
555 .\"O .RB ( sched_setaffinity (2));
556 任意のプロセスに対する CPU affinity を設定できる
557 .RB ( sched_setaffinity (2))。
558 .IP *
559 .\"O set I/O scheduling class and priority for arbitrary processes
560 .\"O .RB ( ioprio_set (2));
561 任意のプロセスに対して I/O スケジューリングクラスと優先度を設定できる
562 .RB ( ioprio_set (2))。
563 .IP *
564 .\"O apply
565 .\"O .BR migrate_pages (2)
566 .\"O to arbitrary processes and allow processes
567 .\"O to be migrated to arbitrary nodes;
568 .BR migrate_pages (2)
569 を任意のプロセスに適用し、プロセスを任意のノードに移動する。
570 .\" FIXME CAP_SYS_NICE also has the following effect for
571 .\" migrate_pages(2):
572 .\"     do_migrate_pages(mm, &old, &new,
573 .\"         capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE);
574 .IP *
575 .\"O apply
576 .\"O .BR move_pages (2)
577 .\"O to arbitrary processes;
578 .BR move_pages (2)
579 を任意のプロセスに対して行う。
580 .IP *
581 .\"O use the
582 .\"O .B MPOL_MF_MOVE_ALL
583 .\"O flag with
584 .\"O .BR mbind (2)
585 .\"O and
586 .\"O .BR move_pages (2).
587 .BR mbind (2)
588
589 .BR move_pages (2)
590
591 .B MPOL_MF_MOVE_ALL
592 フラグを使用する。
593 .RE
594 .PD
595 .TP
596 .B CAP_SYS_PACCT
597 .\"O Use
598 .\"O .BR acct (2).
599 .BR acct (2)
600 を呼び出す。
601 .TP
602 .B CAP_SYS_PTRACE
603 .\"O Trace arbitrary processes using
604 .\"O .BR ptrace (2);
605 .\"O apply
606 .\"O .BR get_robust_list (2)
607 .\"O to arbitrary processes.
608 .BR ptrace (2)
609 を使って任意のプロセスをトレースする。
610 任意のプロセスに
611 .BR get_robust_list (2)
612 を適用する。
613 .TP
614 .B CAP_SYS_RAWIO
615 .\"O Perform I/O port operations
616 .\"O .RB ( iopl (2)
617 .\"O and
618 .\"O .BR ioperm (2));
619 .\"O access
620 .\"O .IR /proc/kcore .
621 I/O ポート操作を実行する
622 .RB ( iopl (2)
623
624 .BR ioperm (2))。
625 .I /proc/kcore
626 にアクセスできる。
627 .TP
628 .B CAP_SYS_RESOURCE
629 .PD 0
630 .RS
631 .IP * 2
632 .\"O Use reserved space on ext2 file systems;
633 ext2 ファイルシステム上の予約されている領域を使用する。
634 .IP *
635 .\"O make
636 .\"O .BR ioctl (2)
637 .\"O calls controlling ext3 journaling;
638 ext3 のジャーナル機能を制御する
639 .BR ioctl (2)
640 を使用する。
641 .IP *
642 .\"O override disk quota limits;
643 ディスク quota の上限を上書きする。
644 .IP *
645 .\"O increase resource limits (see
646 .\"O .BR setrlimit (2));
647 リソース上限を増やす
648 .RB ( setrlimit (2))。
649 .IP *
650 .\"O override
651 .\"O .B RLIMIT_NPROC
652 .\"O resource limit;
653 .B RLIMIT_NPROC
654 リソース制限を上書きする。
655 .IP *
656 .\"O raise
657 .\"O .I msg_qbytes
658 .\"O limit for a System V message queue above the limit in
659 .\"O .I /proc/sys/kernel/msgmnb
660 .\"O (see
661 .\"O .BR msgop (2)
662 .\"O and
663 .\"O .BR msgctl (2)).
664 メッセージキューに関する上限
665 .I msg_qbytes
666
667 .I /proc/sys/kernel/msgmnb
668 に指定されている上限よりも大きく設定する
669 .RB ( msgop (2)
670
671 .BR msgctl (2)
672 参照)。
673 .IP *
674 .\"O use
675 .\"O .BR F_SETPIPE_SZ
676 .\"O to increase the capacity of a pipe above the limit specified by
677 .\"O .IR /proc/sys/fs/pipe-max-size .
678 .I /proc/sys/fs/pipe-max-size
679 に指定されている上限を超えてパイプの容量を増やすのに
680 .B F_SETPIPE_SZ
681 を使用する。
682 .RE
683 .PD
684 .TP
685 .B CAP_SYS_TIME
686 .\"O Set system clock
687 .\"O .RB ( settimeofday (2),
688 .\"O .BR stime (2),
689 .\"O .BR adjtimex (2));
690 .\"O set real-time (hardware) clock.
691 システムクロックを変更する
692 .RB ( settimeofday (2),
693 .BR stime (2),
694 .BR adjtimex (2))。
695 リアルタイム (ハードウェア) クロックを変更する。
696 .TP
697 .B CAP_SYS_TTY_CONFIG
698 .\"O Use
699 .\"O .BR vhangup (2).
700 .BR vhangup (2)
701 を呼び出す。
702 .\"
703 .\"O .SS Past and Current Implementation
704 .SS 過去と現在の実装
705 .\"O A full implementation of capabilities requires that:
706 完全な形のケーパビリティを実装するには、以下の要件を満たす必要がある:
707 .IP 1. 3
708 .\"O For all privileged operations,
709 .\"O the kernel must check whether the thread has the required
710 .\"O capability in its effective set.
711 全ての特権操作について、カーネルはそのスレッドの実効ケーパビリティセットに
712 必要なケーパビリティがあるかを確認する。
713 .IP 2.
714 .\"O The kernel must provide system calls allowing a thread's capability sets to
715 .\"O be changed and retrieved.
716 カーネルで、あるスレッドのケーパビリティセットを変更したり、
717 取得したりできるシステムコールが提供される。
718 .IP 3.
719 .\"O The file system must support attaching capabilities to an executable file,
720 .\"O so that a process gains those capabilities when the file is executed.
721 ファイルシステムが、実行可能ファイルにケーパビリティを付与でき、ファイル
722 実行時にそのケーパビリティをプロセスが取得できるような機能をサポートする。
723 .PP
724 .\"O Before kernel 2.6.24, only the first two of these requirements are met;
725 .\"O since kernel 2.6.24, all three requirements are met.
726 カーネル 2.6.24 より前では、最初の 2つの要件のみが満たされている。
727 カーネル 2.6.24 以降では、3つの要件すべてが満たされている。
728 .\"
729 .\"O .SS Thread Capability Sets
730 .SS スレッドケーパビリティセット
731 .\"O Each thread has three capability sets containing zero or more
732 .\"O of the above capabilities:
733 各スレッドは以下の 3種類のケーパビリティセットを持つ。各々のケーパビリティセットは
734 上記のケーパビリティの組み合わせである (全てのケーパビリティが無効でもよい)。
735 .TP
736 .\"O .IR Permitted :
737 .\"O This is a limiting superset for the effective
738 .\"O capabilities that the thread may assume.
739 .\"O It is also a limiting superset for the capabilities that
740 .\"O may be added to the inheritable set by a thread that does not have the
741 .\"O .B CAP_SETPCAP
742 .\"O capability in its effective set.
743 .IR "許可 (permitted)" :
744 そのスレッドが持つことになっている実効ケーパビリティの
745 限定的なスーパーセットである。
746 これは、実効ケーパビリティセットに
747 .B CAP_SETPCAP
748 ケーパビリティを持っていないスレッドが継承可能ケーパビリティセットに
749 追加可能なケーパビリティの限定的なスーパーセットでもある。
750
751 .\"O If a thread drops a capability from its permitted set,
752 .\"O it can never reacquire that capability (unless it
753 .\"O .BR execve (2)s
754 .\"O either a set-user-ID-root program, or
755 .\"O a program whose associated file capabilities grant that capability).
756 許可ケーパビリティセットから削除してしまったケーパビリティは、
757 (set-user-ID-root プログラムか、
758 そのケーパビリティをファイルケーパビリティで許可しているプログラムを
759 .BR execve (2)
760 しない限りは) もう一度獲得することはできない。
761 .TP
762 .\"O .IR Inheritable :
763 .\"O This is a set of capabilities preserved across an
764 .\"O .BR execve (2).
765 .\"O It provides a mechanism for a process to assign capabilities
766 .\"O to the permitted set of the new program during an
767 .\"O .BR execve (2).
768 .IR "継承可能 (inheritable)" :
769 .BR execve (2)
770 を前後で保持されるケーパビリティセットである。
771 この仕組みを使うことで、あるプロセスが
772 .BR execve (2)
773 を行う際に新しいプログラムの許可ケーパビリティセットとして
774 割り当てるケーパビリティを指定することができる。
775 .TP
776 .\"O .IR Effective :
777 .\"O This is the set of capabilities used by the kernel to
778 .\"O perform permission checks for the thread.
779 .IR "実効 (effective)" :
780 カーネルがスレッドの権限 (permission) をチェックするときに
781 使用するケーパビリティセットである。
782 .PP
783 .\"O A child created via
784 .\"O .BR fork (2)
785 .\"O inherits copies of its parent's capability sets.
786 .\"O See below for a discussion of the treatment of capabilities during
787 .\"O .BR execve (2).
788 .BR fork (2)
789 で作成される子プロセスは、親のケーパビリティセットのコピーを継承する。
790 .BR execve (2)
791 中のケーパビリティの扱いについては下記を参照のこと。
792 .PP
793 .\"O Using
794 .\"O .BR capset (2),
795 .\"O a thread may manipulate its own capability sets (see below).
796 .BR capset (2)
797 を使うと、プロセスは自分自身のケーパビリティセット
798 を操作することができる (下記参照)。
799 .\"
800 .\"O .SS File Capabilities
801 .SS ファイルケーパビリティ
802 .\"O Since kernel 2.6.24, the kernel supports
803 .\"O associating capability sets with an executable file using
804 .\"O .BR setcap (8).
805 .\"O The file capability sets are stored in an extended attribute (see
806 .\"O .BR setxattr (2))
807 .\"O named
808 .\"O .IR "security.capability" .
809 .\"O Writing to this extended attribute requires the
810 .\"O .BR CAP_SETFCAP
811 .\"O capability.
812 カーネル 2.6.24 以降では、
813 .BR setcap (8)
814 を使って実行ファイルにケーパビリティセットを対応付けることができる。
815 ファイルケーパビリティセットは
816 .I "security.capability"
817 という名前の拡張属性に保存される
818 .RB ( setxattr (2)
819 参照)。この拡張属性への書き込みには
820 .B CAP_SETFCAP
821 ケーパビリティが必要である。
822 .\"O The file capability sets,
823 .\"O in conjunction with the capability sets of the thread,
824 .\"O determine the capabilities of a thread after an
825 .\"O .BR execve (2).
826 ファイルケーパビリティセットとスレッドのケーパビリティセットの両方が
827 考慮され、
828 .BR execve (2)
829 後のスレッドのケーパビリティセットが決定される。
830
831 .\"O The three file capability sets are:
832 3 つのファイルケーパビリティセットが定義されている。
833 .TP
834 .\"O .IR Permitted " (formerly known as " forced ):
835 .\"O These capabilities are automatically permitted to the thread,
836 .\"O regardless of the thread's inheritable capabilities.
837 .IR "許可 (Permitted)" " (以前の" "強制 (Forced)" "):"
838 スレッドの継承可能ケーパビリティに関わらず、そのスレッドに自動的に
839 認められるケーパビリティ。
840 .TP
841 .\"O .IR Inheritable " (formerly known as " allowed ):
842 .\"O This set is ANDed with the thread's inheritable set to determine which
843 .\"O inheritable capabilities are enabled in the permitted set of
844 .\"O the thread after the
845 .\"O .BR execve (2).
846 .IR "継承可能 (Inheritable)" " (以前の " "許容 (Allowed)" "):"
847 このセットと、スレッドの継承可能ケーパビリティセットとの
848 論理積 (AND) がとられ、
849 .BR execve (2)
850 の後にそのスレッドの許可ケーパビリティセットで有効となる
851 継承可能ケーパビリティが決定される。
852 .TP
853 .\"O .IR Effective :
854 .IR "実効 (Effective)" :
855 .\"O This is not a set, but rather just a single bit.
856 .\"O If this bit is set, then during an
857 .\"O .BR execve (2)
858 .\"O all of the new permitted capabilities for the thread are
859 .\"O also raised in the effective set.
860 .\"O If this bit is not set, then after an
861 .\"O .BR execve (2),
862 .\"O none of the new permitted capabilities is in the new effective set.
863 これは集合ではなく、1 ビットの情報である。
864 このビットがセットされていると、
865 .BR execve (2)
866 実行中に、そのスレッドの新しい許可ケーパビリティが全て
867 実効ケーパビリティ集合においてもセットされる。
868 このビットがセットされていない場合、
869 .BR execve (2)
870 後には新しい許可ケーパビリティのどれも新しい実効ケーパビリティ集合
871 にセットされない。
872
873 .\"O Enabling the file effective capability bit implies
874 .\"O that any file permitted or inheritable capability that causes a
875 .\"O thread to acquire the corresponding permitted capability during an
876 .\"O .BR execve (2)
877 .\"O (see the transformation rules described below) will also acquire that
878 .\"O capability in its effective set.
879 ファイルの実効ケーパビリティビットを有効にするというのは、
880 .BR execve (2)
881 実行時に、ファイルの許可ケーパビリティと継承ケーパビリティに対応するものが
882 スレッドの許可ケーパビリティセットとしてセットされるが、
883 これが実効ケーパビリティセットにもセットされるということである
884 (ケーパビリティの変換ルールは下記参照)。
885 .\"O Therefore, when assigning capabilities to a file
886 .\"O .RB ( setcap (8),
887 .\"O .BR cap_set_file (3),
888 .\"O .BR cap_set_fd (3)),
889 .\"O if we specify the effective flag as being enabled for any capability,
890 .\"O then the effective flag must also be specified as enabled
891 .\"O for all other capabilities for which the corresponding permitted or
892 .\"O inheritable flags is enabled.
893 したがって、ファイルにケーパビリティを割り当てる際
894 .RB ( setcap (8),
895 .BR cap_set_file (3),
896 .BR cap_set_fd (3))、
897 いずれかのケーパビリティに対して実効フラグを有効と指定する場合、
898 許可フラグや継承可能フラグを有効にした他の全てのケーパビリティ
899 についても実効フラグを有効と指定しなければならない。
900 .\"
901 .\"O .SS Transformation of Capabilities During execve()
902 .SS "execve() 中のケーパビリティの変換"
903 .PP
904 .\"O During an
905 .\"O .BR execve (2),
906 .\"O the kernel calculates the new capabilities of
907 .\"O the process using the following algorithm:
908 .BR execve (2)
909 実行時に、カーネルはプロセスの新しいケーパビリティを次の
910 アルゴリズムを用いて計算する:
911 .in +4n
912 .nf
913
914 P'(permitted) = (P(inheritable) & F(inheritable)) |
915                 (F(permitted) & cap_bset)
916
917 P'(effective) = F(effective) ? P'(permitted) : 0
918
919 .\"O P'(inheritable) = P(inheritable)    [i.e., unchanged]
920 P'(inheritable) = P(inheritable)    [つまり、変更されない]
921
922 .fi
923 .in
924 .\"O where:
925 各変数の意味は以下の通り:
926 .RS 4
927 .IP P 10
928 .\"O denotes the value of a thread capability set before the
929 .\"O .BR execve (2)
930 .BR execve (2)
931 前のスレッドのケーパビリティセットの値
932 .IP P'
933 .\"O denotes the value of a capability set after the
934 .\"O .BR execve (2)
935 .BR execve (2)
936 後のスレッドのケーパビリティセットの値
937 .IP F
938 .\"O denotes a file capability set
939 ファイルケーパビリティセットの値
940 .IP cap_bset
941 .\"O is the value of the capability bounding set (described below).
942 ケーパビリティバウンディングセットの値 (下記参照)
943 .RE
944 .\"
945 .\"O .SS Capabilities and execution of programs by root
946 .SS ケーパビリティと、ルートによるプログラムの実行
947 .\"O In order to provide an all-powerful
948 .\"O .I root
949 .\"O using capability sets, during an
950 .\"O .BR execve (2):
951 .BR execve (2)
952 時に、ケーパビリティセットを使って、全ての権限を持った
953 .I root
954 を実現するには、以下のようにする。
955 .IP 1. 3
956 .\"O If a set-user-ID-root program is being executed,
957 .\"O or the real user ID of the process is 0 (root)
958 .\"O then the file inheritable and permitted sets are defined to be all ones
959 .\"O (i.e., all capabilities enabled).
960 set-user-ID-root プログラムが実行される場合、
961 またはプロセスの実ユーザ ID が 0 (root) の場合、
962 ファイルの継承可能セットと許可セットを全て 1
963 (全てのケーパビリティが有効) に定義する。
964 .IP 2.
965 .\"O If a set-user-ID-root program is being executed,
966 .\"O then the file effective bit is defined to be one (enabled).
967 set-user-ID-root プログラムが実行される場合、
968 ファイルの実効ケーパビリティビットを 1 (enabled) に定義する。
969 .PP
970 .\"O The upshot of the above rules,
971 .\"O combined with the capabilities transformations described above,
972 .\"O is that when a process
973 .\"O .BR execve (2)s
974 .\"O a set-user-ID-root program, or when a process with an effective UID of 0
975 .\"O .BR execve (2)s
976 .\"O a program,
977 .\"O it gains all capabilities in its permitted and effective capability sets,
978 .\"O except those masked out by the capability bounding set.
979 .\"O .\" If a process with real UID 0, and nonzero effective UID does an
980 .\"O .\" exec(), then it gets all capabilities in its
981 .\"O .\" permitted set, and no effective capabilities
982 .\"O This provides semantics that are the same as those provided by
983 .\"O traditional UNIX systems.
984 上記のルールにケーパビリティ変換を適用した結果をまとめると、
985 プロセスが set-user-ID-root プログラムを
986 .BR execve (2)
987 する場合、または実効 UID が 0 のプロセスがプログラムを
988 .BR execve (2)
989 する場合、許可と実効のケーパビリティセットの全ケーパビリティ
990 (正確には、ケーパビリティバウンディングセットによるマスクで除外されるもの
991 以外の全てのケーパビリティ) を取得するということである。
992 .\" 実 UID が 0 で実効 UID が 0 以外のプロセスが exec () を行うと、
993 .\" 許可ケーパビリティセットに含まれる全てのケーパビリティ
994 .\" が取得され、実効ケーパビリティは取得されない。
995 これにより、伝統的な UNIX システムと同じ振る舞いができるようになっている。
996 .\"O .SS Capability bounding set
997 .SS ケーパビリティ・バウンディングセット
998 .\"O The capability bounding set is a security mechanism that can be used
999 .\"O to limit the capabilities that can be gained during an
1000 .\"O .BR execve (2).
1001 ケーパビリティ・バウンディングセット (capability bounding set) は、
1002 .BR execve (2)
1003 時に獲得できるケーパビリティを制限するために使われる
1004 セキュリティ機構である。
1005 .\"O The bounding set is used in the following ways:
1006 バウンディングセットは以下のように使用される。
1007 .IP * 2
1008 .\"O During an
1009 .\"O .BR execve (2),
1010 .\"O the capability bounding set is ANDed with the file permitted
1011 .\"O capability set, and the result of this operation is assigned to the
1012 .\"O thread's permitted capability set.
1013 .\"O The capability bounding set thus places a limit on the permitted
1014 .\"O capabilities that may be granted by an executable file.
1015 .BR execve (2)
1016 実行時に、ケーパビリティ・バウンディングセットと
1017 ファイルの許可ケーパビリティセットの論理和 (AND) を取ったものが、
1018 そのスレッドの許可ケーパビリティセットに割り当てられる。
1019 つまり、ケーパビリティ・バウンディングセットは、
1020 実行ファイルが認めている許可ケーパビリティに対して
1021 制限を課す働きをする。
1022 .IP *
1023 .\"O (Since Linux 2.6.25)
1024 .\"O The capability bounding set acts as a limiting superset for
1025 .\"O the capabilities that a thread can add to its inheritable set using
1026 .\"O .BR capset (2).
1027 .\"O This means that if a capability is not in the bounding set,
1028 .\"O then a thread can't add this capability to its
1029 .\"O inheritable set, even if it was in its permitted capabilities,
1030 .\"O and thereby cannot have this capability preserved in its
1031 .\"O permitted set when it
1032 .\"O .BR execve (2)s
1033 .\"O a file that has the capability in its inheritable set.
1034 (Linux 2.6.25 以降)
1035 ケーパビリティ・バウンディングセットは、スレッドが
1036 .BR capset (2)
1037 により自身の継承可能セットに追加可能なケーパビリティの母集団を
1038 制限する役割を持つ。
1039 スレッドに許可されたケーパビリティであっても、バウンディングセットに
1040 含まれていなければ、スレッドはそのケーパビリティは自身の継承可能セットに
1041 追加できず、その結果、継承可能セットにそのケーパビリティを含むファイルを
1042 .BR execve (2)
1043 する場合、そのケーパビリティを許可セットに持ち続けることができない、
1044 ということである。
1045 .PP
1046 .\"O Note that the bounding set masks the file permitted capabilities,
1047 .\"O but not the inherited capabilities.
1048 .\"O If a thread maintains a capability in its inherited set
1049 .\"O that is not in its bounding set,
1050 .\"O then it can still gain that capability in its permitted set
1051 .\"O by executing a file that has the capability in its inherited set.
1052 バウンディングセットがマスクを行うのは、継承可能ケーパビリティではなく、
1053 ファイルの許可ケーパビリティのマスクを行う点に注意すること。
1054 あるスレッドの継承可能セットにそのスレッドのバウンディングセットに
1055 存在しないケーパビリティが含まれている場合、そのスレッドは、
1056 継承可能セットに含まれるケーパビリティを持つファイルを実行することにより、
1057 許可セットに含まれるケーパビリティも獲得できるということである。
1058 .PP
1059 .\"O Depending on the kernel version, the capability bounding set is either
1060 .\"O a system-wide attribute, or a per-process attribute.
1061 カーネルのバージョンにより、ケーパビリティ・バウンディングセットは
1062 システム共通の属性の場合と、プロセス単位の属性の場合がある。
1063 .PP
1064 .\"O .B "Capability bounding set prior to Linux 2.6.25"
1065 .B "Linux 2.6.25 より前のケーパビリティ・バウンディングセット"
1066 .PP
1067 .\"O In kernels before 2.6.25, the capability bounding set is a system-wide
1068 .\"O attribute that affects all threads on the system.
1069 2.6.25 より前のカーネルでは、ケーパビリティ・バウンディングセットは
1070 システム共通の属性で、システム上の全てのスレッドに適用される。
1071 .\"O The bounding set is accessible via the file
1072 .\"O .IR /proc/sys/kernel/cap-bound .
1073 .\"O motoki: accessible = 「参照可能」でよいか、文脈を要確認
1074 バウンディングセットは
1075 .I /proc/sys/kernel/cap-bound
1076 ファイル経由で参照できる。
1077 .\"O (Confusingly, this bit mask parameter is expressed as a
1078 .\"O signed decimal number in
1079 .\"O .IR /proc/sys/kernel/cap-bound .)
1080 (間違えやすいが、このビットマスク形式のパラメータは、
1081 .I /proc/sys/kernel/cap-bound
1082 では符号付きの十進数で表現される。)
1083
1084 .\"O Only the
1085 .\"O .B init
1086 .\"O process may set capabilities in the capability bounding set;
1087 .\"O other than that, the superuser (more precisely: programs with the
1088 .\"O .B CAP_SYS_MODULE
1089 .\"O capability) may only clear capabilities from this set.
1090 .B init
1091 プロセスだけがケーパビリティ・バウンディングセットで
1092 ケーパビリティをセットすることができる。
1093 それ以外では、スーパーユーザ (より正確には、
1094 .B CAP_SYS_MODULE
1095 ケーパビリティを持ったプログラム) が、
1096 ケーパビリティ・バウンディングセットのケーパビリティのクリアが
1097 できるだけである。
1098
1099 .\"O On a standard system the capability bounding set always masks out the
1100 .\"O .B CAP_SETPCAP
1101 .\"O capability.
1102 .\"O To remove this restriction (dangerous!), modify the definition of
1103 .\"O .B CAP_INIT_EFF_SET
1104 .\"O in
1105 .\"O .I include/linux/capability.h
1106 .\"O and rebuild the kernel.
1107 通常のシステムでは、ケーパビリティ・バウンディングセットは、
1108 .B CAP_SETPCAP
1109 が無効になっている。
1110 この制限を取り去るには (取り去るのは危険!)、
1111 .I include/linux/capability.h
1112 内の
1113 .B CAP_INIT_EFF_SET
1114 の定義を修正し、カーネルを再構築する必要がある。
1115
1116 .\"O The system-wide capability bounding set feature was added
1117 .\"O to Linux starting with kernel version 2.2.11.
1118 システム共通のケーパビリティ・バウンディングセット機能は、
1119 カーネル 2.2.11 以降で Linux に追加された。
1120 .\"
1121 .PP
1122 .\"O .B "Capability bounding set from Linux 2.6.25 onward"
1123 .B "Linux 2.6.25 以降のケーパビリティ・バウンディングセット"
1124 .PP
1125 .\"O From Linux 2.6.25, the
1126 .\"O .I "capability bounding set"
1127 .\"O is a per-thread attribute.
1128 .\"O (There is no longer a system-wide capability bounding set.)
1129 Linux 2.6.25 以降では、
1130 「ケーパビリティ・バウンディングセット」はスレッド単位の属性である
1131 (システム共通のケーパビリティ・バウンディングセットはもはや存在しない)。
1132
1133 .\"O The bounding set is inherited at
1134 .\"O .BR fork (2)
1135 .\"O from the thread's parent, and is preserved across an
1136 .\"O .BR execve (2).
1137 バウンディングセットは
1138 .BR fork (2)
1139 時にはスレッドの親プロセスから継承され、
1140 .BR execve (2)
1141 の前後では保持される。
1142
1143 .\"O A thread may remove capabilities from its capability bounding set using the
1144 .\"O .BR prctl (2)
1145 .\"O .B PR_CAPBSET_DROP
1146 .\"O operation, provided it has the
1147 .\"O .B CAP_SETPCAP
1148 .\"O capability.
1149 .\"O Once a capability has been dropped from the bounding set,
1150 .\"O it cannot be restored to that set.
1151 .\"O A thread can determine if a capability is in its bounding set using the
1152 .\"O .BR prctl (2)
1153 .\"O .B PR_CAPBSET_READ
1154 .\"O operation.
1155 スレッドが
1156 .B CAP_SETPCAP
1157 ケーパビリティを持っている場合、そのスレッドは
1158 .BR prctl (2)
1159
1160 .BR PR_CAPBSET_DROP
1161 操作を使って自身のケーパビリティ・バウンディングセットから
1162 ケーパビリティを削除することができる。
1163 いったんケーパビリティをバウンディングセットから削除してしまうと、
1164 スレッドはそのケーパビリティを再度セットすることはできない。
1165 .BR prctl (2)
1166
1167 .B PR_CAPBSET_READ
1168 操作を使うことで、スレッドがあるケーパビリティが自身のバウンディングセット
1169 に含まれているかを知ることができる。
1170
1171 .\"O Removing capabilities from the bounding set is only supported if file
1172 .\"O capabilities are compiled into the kernel
1173 .\"O (CONFIG_SECURITY_FILE_CAPABILITIES).
1174 .\"O In that case, the
1175 .\"O .B init
1176 .\"O process (the ancestor of all processes) begins with a full bounding set.
1177 .\"O If file capabilities are not compiled into the kernel, then
1178 .\"O .B init
1179 .\"O begins with a full bounding set minus
1180 .\"O .BR CAP_SETPCAP ,
1181 .\"O because this capability has a different meaning when there are
1182 .\"O no file capabilities.
1183 バウンディングセットからのケーパビリティの削除がサポートされるのは、
1184 カーネルのコンパイル時にファイルケーパビリティが有効になっている場合
1185 (CONFIG_SECURITY_FILE_CAPABILITIES) だけである。
1186 この場合には、 (全てのプロセスの先祖である) 
1187 .I init
1188 プロセスはバウンディングセットで全てのケーパビリティが
1189 セットされた状態で開始する。
1190 ファイルケーパビリティが有効になっていない場合には、
1191 .I init
1192 はバウンディングセットで
1193 .B CAP_SETPCAP
1194 以外の全てのケーパビリティがセットされた状態で開始する。
1195 このようになっているのは、
1196 .B CAP_SETPCAP
1197 ケーパビリティがファイルケーパビリティがサポートされていない場合には
1198 違った意味を持つからである。
1199
1200 .\"O Removing a capability from the bounding set does not remove it
1201 .\"O from the thread's inherited set.
1202 .\"O However it does prevent the capability from being added
1203 .\"O back into the thread's inherited set in the future.
1204 バウンディングセットからケーパビリティを削除しても、
1205 スレッドの継承可能セットからはそのケーパビリティは削除されない。
1206 しかしながら、バウンディングセットからの削除により、
1207 この先そのケーパビリティをスレッドの継承可能セットに追加すること
1208 はできなくなる。
1209 .\"
1210 .\"
1211 .\"O .SS Effect of User ID Changes on Capabilities
1212 .SS "ユーザ ID 変更のケーパビリティへの影響"
1213 .\"O To preserve the traditional semantics for transitions between
1214 .\"O 0 and nonzero user IDs,
1215 .\"O the kernel makes the following changes to a thread's capability
1216 .\"O sets on changes to the thread's real, effective, saved set,
1217 .\"O and file system user IDs (using
1218 .\"O .BR setuid (2),
1219 .\"O .BR setresuid (2),
1220 .\"O or similar):
1221 ユーザ ID が 0 と 0 以外の間で変化する際の振る舞いを従来と同じにするため、
1222 スレッドの実 UID、実効 UID、保存 set-user-ID、ファイルシステム UID が
1223 .RB ( setuid (2),
1224 .BR setresuid (2)
1225 などを使って) 変更された際に、カーネルはそのスレッドのケーパビリティセットに
1226 以下の変更を行う:
1227 .IP 1. 3
1228 .\"O If one or more of the real, effective or saved set user IDs
1229 .\"O was previously 0, and as a result of the UID changes all of these IDs
1230 .\"O have a nonzero value,
1231 .\"O then all capabilities are cleared from the permitted and effective
1232 .\"O capability sets.
1233 UID の変更前には実 UID、実効 UID、保存 set-user-ID のうち
1234 少なくとも一つが 0 で、変更後に実 UID、実効 UID、保存 set-user-ID が
1235 すべて 0 以外の値になった場合、許可と実効のケーパビリティセットの
1236 全ケーパビリティをクリアする。
1237 .IP 2.
1238 .\"O If the effective user ID is changed from 0 to nonzero,
1239 .\"O then all capabilities are cleared from the effective set.
1240 実効 UID が 0 から 0 以外に変更された場合、
1241 実効ケーパビリティセットの全ケーパビリティをクリアする。
1242 .IP 3.
1243 .\"O If the effective user ID is changed from nonzero to 0,
1244 .\"O then the permitted set is copied to the effective set.
1245 実効 UID が 0 以外から 0 に変更された場合、
1246 許可ケーパビリティセットの内容を実効ケーパビリティセットにコピーする。
1247 .IP 4.
1248 .\"O If the file system user ID is changed from 0 to nonzero (see
1249 .\"O .BR setfsuid (2))
1250 .\"O then the following capabilities are cleared from the effective set:
1251 .\"O .BR CAP_CHOWN ,
1252 .\"O .BR CAP_DAC_OVERRIDE ,
1253 .\"O .BR CAP_DAC_READ_SEARCH ,
1254 .\"O .BR CAP_FOWNER ,
1255 .\"O .BR CAP_FSETID ,
1256 .\"O .B CAP_LINUX_IMMUTABLE
1257 .\"O (since Linux 2.2.30),
1258 .\"O .BR CAP_MAC_OVERRIDE ,
1259 .\"O and
1260 .\"O .B CAP_MKNOD
1261 .\"O (since Linux 2.2.30).
1262 ファイルシステム UID が 0 から 0 以外に変更された場合
1263 .RB ( setfsuid (2)
1264 参照)、実効ケーパビリティセットの以下のケーパビリティがクリアされる:
1265 .BR CAP_CHOWN ,
1266 .BR CAP_DAC_OVERRIDE ,
1267 .BR CAP_DAC_READ_SEARCH ,
1268 .BR CAP_FOWNER ,
1269 .BR CAP_FSETID ,
1270 .B CAP_LINUX_IMMUTABLE
1271 (Linux 2.2.30 以降),
1272 .BR CAP_MAC_OVERRIDE ,
1273 .B CAP_MKNOD
1274 (Linux 2.2.30 以降)。
1275 .\"O If the file system UID is changed from nonzero to 0,
1276 .\"O then any of these capabilities that are enabled in the permitted set
1277 .\"O are enabled in the effective set.
1278 ファイルシステム UID が 0 以外から 0 に変更された場合、
1279 上記のケーパビリティのうち許可ケーパビリティセットで有効になっているものが
1280 実効ケーパビリティセットで有効にされる。
1281 .PP
1282 .\"O If a thread that has a 0 value for one or more of its user IDs wants
1283 .\"O to prevent its permitted capability set being cleared when it resets
1284 .\"O all of its user IDs to nonzero values, it can do so using the
1285 .\"O .BR prctl (2)
1286 .\"O .B PR_SET_KEEPCAPS
1287 .\"O operation.
1288 各種 UID のうち少なくとも一つが 0 であるスレッドが、
1289 その UID の全てが 0 以外になったときに許可ケーパビリティセットが
1290 クリアされないようにしたい場合には、
1291 .BR prctl (2)
1292
1293 .B PR_SET_KEEPCAPS
1294 操作を使えばよい。
1295 .\"
1296 .\"O .SS Programmatically adjusting capability sets
1297 .SS プログラムでケーパビリティセットを調整する
1298 .\"O A thread can retrieve and change its capability sets using the
1299 .\"O .BR capget (2)
1300 .\"O and
1301 .\"O .BR capset (2)
1302 .\"O system calls.
1303 .\"O However, the use of
1304 .\"O .BR cap_get_proc (3)
1305 .\"O and
1306 .\"O .BR cap_set_proc (3),
1307 .\"O both provided in the
1308 .\"O .I libcap
1309 .\"O package,
1310 .\"O is preferred for this purpose.
1311 各スレッドは、
1312 .BR capget (2)
1313
1314 .BR capset (2)
1315 を使って、自身のケーパビリティセットを取得したり変更したりできる。
1316 ただし、これを行うには、
1317 .I libcap
1318 パッケージで提供されている
1319 .BR cap_get_proc (3)
1320
1321 .BR cap_set_proc (3)
1322 を使うのが望ましい。
1323 .\"O The following rules govern changes to the thread capability sets:
1324 スレッドのケーパビリティセットの変更には以下のルールが適用される。
1325 .IP 1. 3
1326 .\"O If the caller does not have the
1327 .\"O .B CAP_SETPCAP
1328 .\"O capability,
1329 .\"O the new inheritable set must be a subset of the combination
1330 .\"O of the existing inheritable and permitted sets.
1331 .\"O [XXX] motoki: combination って AND ? OR ?
1332 呼び出し側が
1333 .B CAP_SETPCAP
1334 ケーパビリティを持っていない場合、新しい継承可能セットは、
1335 既存の継承可能セットと許可セットの積集合 (AND) の部分集合で
1336 なければならない。
1337 .IP 2.
1338 .\"O (Since kernel 2.6.25)
1339 .\"O The new inheritable set must be a subset of the combination of the
1340 .\"O existing inheritable set and the capability bounding set.
1341 .\"O [XXX] motoki: combination って AND ? OR ?
1342 (カーネル 2.6.25 以降)
1343 新しい継承可能セットは、既存の継承可能セットとケーパビリティ・
1344 バウンディングセットの積集合 (AND) の部分集合でなければならない。
1345 .IP 3.
1346 .\"O The new permitted set must be a subset of the existing permitted set
1347 .\"O (i.e., it is not possible to acquire permitted capabilities
1348 .\"O that the thread does not currently have).
1349 新しい許可セットは、既存の許可セットの部分集合でなければならない
1350 (つまり、そのスレッドが現在持っていない許可ケーパビリティを
1351 獲得することはできない)。
1352 .IP 4.
1353 .\"O The new effective set must be a subset of the new permitted set.
1354 新しい実効ケーパビリティセットは新しい許可ケーパビリティセットの
1355 部分集合になっていなければならない。
1356 .\"O .SS The """securebits"" flags: establishing a capabilities-only environment
1357 .SS securebits フラグ: ケーパビリティだけの環境を構築する
1358 .\" For some background:
1359 .\"       see http://lwn.net/Articles/280279/ and
1360 .\"       http://article.gmane.org/gmane.linux.kernel.lsm/5476/
1361 .\"O Starting with kernel 2.6.26,
1362 .\"O and with a kernel in which file capabilities are enabled,
1363 .\"O Linux implements a set of per-thread
1364 .\"O .I securebits
1365 .\"O flags that can be used to disable special handling of capabilities for UID 0
1366 .\"O .RI ( root ).
1367 カーネル 2.6.26 以降で、
1368 ファイルケーパビリティが有効になったカーネルでは、
1369 スレッド単位の
1370 .I securebits
1371 フラグが実装されており、このフラグを使うと UID 0
1372 .RI ( root )
1373 に対するケーパビリティの特別扱いを無効することができる。
1374 .\"O These flags are as follows:
1375 以下のようなフラグがある。
1376 .TP
1377 .B SECBIT_KEEP_CAPS
1378 .\"O Setting this flag allows a thread that has one or more 0 UIDs to retain
1379 .\"O its capabilities when it switches all of its UIDs to a nonzero value.
1380 .\"O If this flag is not set,
1381 .\"O then such a UID switch causes the thread to lose all capabilities.
1382 .\"O This flag is always cleared on an
1383 .\"O .BR execve (2).
1384 .\"O (This flag provides the same functionality as the older
1385 .\"O .BR prctl (2)
1386 .\"O .B PR_SET_KEEPCAPS
1387 .\"O operation.)
1388 このフラグをセットされている場合、UID が 0 のスレッドの UID が 0 以外の値に
1389 切り替わる際に、そのスレッドはケーパビリティを維持することができる。
1390 このフラグがセットされていない場合には、UID が 0 から 0 以外の値に
1391 切り替わると、そのスレッドは全てのケーパビリティを失う。
1392 このフラグは
1393 .BR execve (2)
1394 時には全てクリアされる
1395 (このフラグは、以前の
1396 .BR prctl (2)
1397
1398 .B PR_SET_KEEPCAPS
1399 操作と同じ機能を提供するものである)。
1400 .TP
1401 .B SECBIT_NO_SETUID_FIXUP
1402 .\"O Setting this flag stops the kernel from adjusting  capability sets when
1403 .\"O the threads's effective and file system UIDs are switched between
1404 .\"O zero and nonzero values.
1405 .\"O (See the subsection
1406 .\"O .IR "Effect of User ID Changes on Capabilities" .)
1407 このフラグをセットすると、スレッドの実効 UID とファイルシステム UID が
1408 0 と 0 以外の間で切り替わった場合に、
1409 カーネルはケーパビリティセットの調整を行わなくなる
1410 (「ユーザ ID 変更のケーパビリティへの影響」の節を参照)。
1411 .TP
1412 .B SECBIT_NOROOT
1413 .\"O If this bit is set, then the kernel does not grant capabilities
1414 .\"O when a set-user-ID-root program is executed, or when a process with
1415 .\"O an effective or real UID of 0 calls
1416 .\"O .BR execve (2).
1417 .\"O (See the subsection
1418 .\"O .IR "Capabilities and execution of programs by root" .)
1419 このビットがセットされている場合、
1420 set-user-ID-root プログラムの実行時や、
1421 実効 UID か 実 UID が 0 のプロセスが
1422 .BR execve (2)
1423 を呼び出した時に、カーネルはケーパビリティを許可しない
1424 (「ケーパビリティと、ルートによるプログラムの実行」の節を参照)。
1425 .PP
1426 .\"O Each of the above "base" flags has a companion "locked" flag.
1427 .\"O Setting any of the "locked" flags is irreversible,
1428 .\"O and has the effect of preventing further changes to the
1429 .\"O corresponding "base" flag.
1430 .\"O The locked flags are:
1431 .\"O .BR SECBIT_KEEP_CAPS_LOCKED ,
1432 .\"O .BR SECBIT_NO_SETUID_FIXUP_LOCKED ,
1433 .\"O and
1434 .\"O .BR SECBIT_NOROOT_LOCKED .
1435 上記の "base" フラグの各々には対応する "locked" フラグが存在する。
1436 いずれの "locked" フラグも一度セットされると戻すことはできず、
1437 それ以降は対応する "base" フラグを変更することができなくなる。
1438 "locked" フラグは
1439 .BR SECBIT_KEEP_CAPS_LOCKED ,
1440 .BR SECBIT_NO_SETUID_FIXUP_LOCKED ,
1441 .BR SECBIT_NOROOT_LOCKED
1442 という名前である。
1443 .PP
1444 .\"O The
1445 .\"O .I securebits
1446 .\"O flags can be modified and retrieved using the
1447 .\"O .BR prctl (2)
1448 .\"O .B PR_SET_SECUREBITS
1449 .\"O and
1450 .\"O .B PR_GET_SECUREBITS
1451 .\"O operations.
1452 .\"O The
1453 .\"O .B CAP_SETPCAP
1454 .\"O capability is required to modify the flags.
1455 .I securebits
1456 フラグは、
1457 .BR prctl (2)
1458 の操作
1459 .B PR_SET_SECUREBITS
1460
1461 .B PR_GET_SECUREBITS
1462 を使うことで変更したり取得したりできる。
1463 フラグを変更するには
1464 .B CAP_SETPCAP
1465 ケーパビリティが必要である。
1466
1467 .\"O The
1468 .\"O .I securebits
1469 .\"O flags are inherited by child processes.
1470 .\"O During an
1471 .\"O .BR execve (2),
1472 .\"O all of the flags are preserved, except
1473 .\"O .B SECURE_KEEP_CAPS
1474 .\"O which is always cleared.
1475 .I securebits
1476 フラグは子プロセスに継承される。
1477 .BR execve (2)
1478 においては、
1479 .B SECURE_KEEP_CAPS
1480 が常にクリアされる以外は、全てのフラグが保持される。
1481
1482 .\"O An application can use the following call to lock itself,
1483 .\"O and all of its descendants,
1484 .\"O into an environment where the only way of gaining capabilities
1485 .\"O is by executing a program with associated file capabilities:
1486 アプリケーションは、以下の呼び出しを行うことにより、
1487 自分自身および子孫となるプロセス全てに対して、
1488 必要なファイルケーパビリティを持ったプログラムを実行しない限り、
1489 対応するケーパビリティを獲得できないような状況に閉じこめることができる。
1490 .in +4n
1491 .nf
1492
1493 prctl(PR_SET_SECUREBITS,
1494         SECBIT_KEEP_CAPS_LOCKED |
1495         SECBIT_NO_SETUID_FIXUP |
1496         SECBIT_NO_SETUID_FIXUP_LOCKED |
1497         SECBIT_NOROOT |
1498         SECBIT_NOROOT_LOCKED);
1499 .fi
1500 .in
1501 .\"O .SH "CONFORMING TO"
1502 .SH 準拠
1503 .PP
1504 .\"O No standards govern capabilities, but the Linux capability implementation
1505 .\"O is based on the withdrawn POSIX.1e draft standard; see
1506 .\"O .IR http://wt.xpilot.org/publications/posix.1e/ .
1507 ケーパビリティに関する標準はないが、 Linux のケーパビリティは廃案になった
1508 POSIX.1e 草案に基づいて実装されている。
1509 .I http://wt.xpilot.org/publications/posix.1e/
1510 を参照。
1511 .\"O .SH NOTES
1512 .SH 注意
1513 .\"O Since kernel 2.5.27, capabilities are an optional kernel component,
1514 .\"O and can be enabled/disabled via the CONFIG_SECURITY_CAPABILITIES
1515 .\"O kernel configuration option.
1516 カーネル 2.5.27 以降、ケーパビリティは選択式のカーネルコンポーネント
1517 となっており、カーネル設定オプション CONFIG_SECURITY_CAPABILITIES
1518 により有効/無効を切り替えることができる。
1519
1520 .\"O The
1521 .\"O .I /proc/PID/task/TID/status
1522 .\"O file can be used to view the capability sets of a thread.
1523 .\"O The
1524 .\"O .I /proc/PID/status
1525 .\"O file shows the capability sets of a process's main thread.
1526 .I /proc/PID/task/TID/status
1527 ファイルを使うと、スレッドのケーパビリティセットを見ることができる。
1528 .I /proc/PID/status
1529 ファイルには、プロセスのメインスレッドのケーパビリティセットが表示される。
1530
1531 .\"O The
1532 .\"O .I libcap
1533 .\"O package provides a suite of routines for setting and
1534 .\"O getting capabilities that is more comfortable and less likely
1535 .\"O to change than the interface provided by
1536 .\"O .BR capset (2)
1537 .\"O and
1538 .\"O .BR capget (2).
1539 .I libcap
1540 パッケージは、ケーパビリティを設定・取得するための
1541 ルーチン群を提供している。これらのインタフェースは、
1542 .BR capset (2)
1543
1544 .BR capget (2)
1545 が提供するインターフェースと比べて、より使いやすく、変更される可能性が少ない。
1546 .\"O This package also provides the
1547 .\"O .BR setcap (8)
1548 .\"O and
1549 .\"O .BR getcap (8)
1550 .\"O programs.
1551 .\"O It can be found at
1552 .\"O .br
1553 .\"O .IR http://www.kernel.org/pub/linux/libs/security/linux-privs .
1554 このパッケージでは、
1555 .BR setcap (8),
1556 .BR getcap (8)
1557 というプログラムも提供されている。
1558 パッケージは
1559 .I http://www.kernel.org/pub/linux/libs/security/linux-privs
1560 で入手できる。
1561
1562 .\"O Before kernel 2.6.24, and since kernel 2.6.24 if
1563 .\"O file capabilities are not enabled, a thread with the
1564 .\"O .B CAP_SETPCAP
1565 .\"O capability can manipulate the capabilities of threads other than itself.
1566 .\"O However, this is only theoretically possible,
1567 .\"O since no thread ever has
1568 .\"O .BR CAP_SETPCAP
1569 .\"O in either of these cases:
1570 バージョン 2.6.24 より前、およびファイルケーパビリティが
1571 有効になっていない2.6.24 以降のカーネルでは、
1572 .B CAP_SETPCAP
1573 ケーパビリティを持ったスレッドは自分以外のスレッドの
1574 ケーパビリティを操作できる。
1575 しかしながら、これは理論的に可能というだけである。
1576 以下のいずれかの場合においても、どのスレッドも
1577 .BR CAP_SETPCAP
1578 ケーパビリティを持つことはないからである。
1579 .IP * 2
1580 .\"O In the pre-2.6.25 implementation the system-wide capability bounding set,
1581 .\"O .IR /proc/sys/kernel/cap-bound ,
1582 .\"O always masks out this capability, and this can not be changed
1583 .\"O without modifying the kernel source and rebuilding.
1584 2.6.25 より前の実装では、システム共通のケーパビリティ・バウンディングセット
1585 .I /proc/sys/kernel/cap-bound
1586 ではこのケーパビリティは常に無効になっており、
1587 ソースを変更してカーネルを再コンパイルしない限り、
1588 これを変更することはできない。
1589 .IP *
1590 .\"O If file capabilities are disabled in the current implementation, then
1591 .\"O .B init
1592 .\"O starts out with this capability removed from its per-process bounding
1593 .\"O set, and that bounding set is inherited by all other processes
1594 .\"O created on the system.
1595 現在の実装ではファイルケーパビリティが無効になっている場合、
1596 プロセス毎のバウンディングセットからこのケーパビリティを抜いて
1597 .B init
1598 は開始され、
1599 システム上で生成される他の全てのプロセスでこのバウンディングセットが
1600 継承される。
1601 .\"O .SH "SEE ALSO"
1602 .SH 関連項目
1603 .BR capget (2),
1604 .BR prctl (2),
1605 .BR setfsuid (2),
1606 .BR cap_clear (3),
1607 .BR cap_copy_ext (3),
1608 .BR cap_from_text (3),
1609 .BR cap_get_file (3),
1610 .BR cap_get_proc (3),
1611 .BR cap_init (3),
1612 .BR capgetp (3),
1613 .BR capsetp (3),
1614 .BR credentials (7),
1615 .BR pthreads (7),
1616 .BR getcap (8),
1617 .BR setcap (8)
1618 .PP
1619 .\"O .I include/linux/capability.h
1620 .\"O in the kernel source
1621 カーネルソース内の
1622 .I include/linux/capability.h