OSDN Git Service

Complete execve.2
authorAkihiro MOTOKI <amotoki@gmail.com>
Wed, 7 Jan 2015 08:45:44 +0000 (17:45 +0900)
committerAkihiro MOTOKI <amotoki@gmail.com>
Wed, 7 Jan 2015 08:45:44 +0000 (17:45 +0900)
draft/man2/execve.2
po4a/unistd/po/ja.po
stats/unistd
untrans.html

index 3acd2eb..78cb800 100644 (file)
@@ -259,9 +259,8 @@ POSIX.1\-2001 は、動作が無視かデフォルトに設定されている全
 .TP 
 \fBEAGAIN\fP (Linux 3.1 以降)
 .\" commit 72fa59970f8698023045ab0713d66f3f4f96945c
-Having changed its real UID using one of the \fBset*uid\fP()  calls, the caller
-was\(emand is now still\(emabove its \fBRLIMIT_NPROC\fP resource limit (see
-\fBsetrlimit\fP(2)).  For a more detailed explanation of this error, see NOTES.
+\fBset*uid\fP() のいずれかの呼び出しでプロセスの実 UID が変更されたとすると、呼び出し元の \fBRLIMIT_NPROC\fP リソース上限
+(\fBsetrlimit\fP(2) 参照) を超えてしまう、 現在もまだ超えている。 このエラーの詳細な説明については「注意」の節を参照。
 .TP 
 \fBEFAULT\fP
 \fIfilename\fP または配列 \fIargv\fP か \fIenvp\fP のポインタの一つがアクセス可能なアドレス空間の外を指している。
@@ -362,38 +361,28 @@ POSIX.1\-2001 は、 \fBsysconf\fP(3)  が返す値はプロセスの生存中
 .\" that could be exploited for denial of service by a suitably crafted
 .\" ELF binary. There are no known problems with 2.0.34 or 2.2.15.
 Linux はスクリプトの set\-user\-ID と set\-group\-ID ビットを無視する。
-.SS "execve() and EAGAIN"
-A more detailed explanation of the \fBEAGAIN\fP error that can occur (since
-Linux 3.1) when calling \fBexecve\fP()  is as follows.
+.SS "execve() と EAGAIN"
+\fBexecve\fP() を呼び出した際に (Linux 3.1 以降で) 起こり得る \fBEAGAIN\fP エラーの詳細な説明を以下で行う。
 
 .\" commit 909cc4ae86f3380152a18e2a3c44523893ee11c4
-The \fBEAGAIN\fP error can occur when a \fIpreceding\fP call to \fBsetuid\fP(2),
-\fBsetreuid\fP(2), or \fBsetresuid\fP(2)  caused the real user ID of the process
-to change, and that change caused the process to exceed its \fBRLIMIT_NPROC\fP
-resource limit (i.e., the number of processes belonging to the new real UID
-exceeds the resource limit).  From Linux 2.6.0 to 3.0, this caused the
-\fBset*uid\fP()  call to fail.  (Prior to 2.6, the resource limit was not
-imposed on processes that changed their user IDs.)
-
-Since Linux 3.1, the scenario just described no longer causes the
-\fBset*uid\fP()  call to fail, because it too often led to security holes where
-buggy applications didn't check the return status and assumed that\(emif the
-caller had root privileges\(emthe call would always succeed.  Instead, the
-\fBset*uid\fP()  calls now successfully change the real UID, but the kernel
-sets an internal flag, named \fBPF_NPROC_EXCEEDED\fP, to note that the
-\fBRLIMIT_NPROC\fP resource limit has been exceeded.  If the
-\fBPF_NPROC_EXCEEDED\fP flag is set and the resource limit is still exceeded at
-the time of a subsequent \fBexecve\fP()  call, that call fails with the error
-\fBEAGAIN\fP.  This kernel logic ensures that the \fBRLIMIT_NPROC\fP resource
-limit is still enforced for the common privileged daemon workflow\(emnamely,
-\fBfork\fP(2)  + \fBset*uid\fP()  + \fBexecve\fP().
-
-If the resource limit was not still exceeded at the time of the \fBexecve\fP()
-call (because other processes belonging to this real UID terminated between
-the \fBset*uid()\fP call and the \fBexecve\fP()  call), then the \fBexecve\fP()  call
-succeeds and the kernel clears the \fBPF_NPROC_EXCEEDED\fP process flag.  The
-flag is also cleared if a subsequent call to \fBfork\fP(2)  by this process
-succeeds.
+\fI直前の\fP \fBsetuid\fP(2), \fBsetreuid\fP(2), \fBsetresuid\fP(2) の呼び出しで、 そのプロセスの実ユーザー ID
+が変更され、 その変更によりそのプロセスが \fBRLIMIT_NPROC\fP リソース上限を超過してしまった場合 (すなわち、新しい実ユーザー ID
+に属するプロセス数が \fBRLIMIT_NPROC\fP リソース上限を超過した場合) に、 \fBEAGAIN\fP エラーが発生する。 Linux 2.6.0
+以上 3.0 以下では、これにより \fBset*uid\fP() の呼び出しが失敗していた。 (Linux 2.6 より前では、このリソース上限はユーザー
+ID を変更したプロセスには適用されていなかった。)
+
+Linux 3.1 以降では、上で説明したシナリオでは \fBset*uid\fP() の呼び出しは失敗しない。 なぜなら、
+返されたステータスの確認を行わず「呼び出し元が特権を持っている場合には」呼び出しは必ず成功するとみなしているバグがあるアプリケーションでは、セキュリティホールにつながることが非常によくあるからだ。
+その代わり、 \fBset*uid\fP() の呼び出しによる実 UID の変更は成功するが、 カーネルは \fBPF_NPROC_EXCEEDED\fP
+という名前の内部フラグをセットする。 このフラグは \fBRLIMIT_NPROC\fP リソース上限が超過したことを示す。
+\fBPF_NPROC_EXCEEDED\fP フラグがセットされていて、その後で \fBexecve\fP() が呼ばれた際にリソース上限がまだ超過していれば、
+その \fBexecve\fP() の呼び出しは \fBEAGAIN\fP エラーで失敗する。 このカーネルのロジックにより、
+特権デーモンでよく行われる処理フロー、 すなわち \fBfork\fP(2)  + \fBset*uid\fP()  + \fBexecve\fP()
+に対して、前と変わらず \fBRLIMIT_NPROC\fP リソース上限を適用できることが保証される。
+
+(\fBset*uid\fP() と \fBexecve\fP() の呼び出しの間に、この実 UID に属する他のプロセスが終了して) 次に \fBexecve\fP()
+が呼び出された際にこのリソース上限が超過してなければ、 \fBexecve\fP() の呼び出しは成功し、カーネルは \fBPF_NPROC_EXCEEDED\fP
+プロセスフラグをクリアする。 同じプロセスによって \fBfork\fP(2) の呼び出しが後で行われた場合にも、このフラグはクリアされる。
 .SS 歴史
 .\"
 .\" .SH BUGS
index 8c8c3b2..980fb70 100644 (file)
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "POT-Creation-Date: 2015-01-04 23:49+0900\n"
-"PO-Revision-Date: 2015-01-05 07:09+0900\n"
+"PO-Revision-Date: 2015-01-07 15:41+0900\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language: \n"
@@ -6170,7 +6170,7 @@ msgid ""
 "Having changed its real UID using one of the B<set*uid>()  calls, the caller "
 "was\\(emand is now still\\(emabove its B<RLIMIT_NPROC> resource limit (see "
 "B<setrlimit>(2)).  For a more detailed explanation of this error, see NOTES."
-msgstr ""
+msgstr "B<set*uid>() のいずれかの呼び出しでプロセスの実 UID が変更されたとすると、呼び出し元の B<RLIMIT_NPROC> リソース上限 (B<setrlimit>(2) 参照) を超えてしまう、 現在もまだ超えている。 このエラーの詳細な説明については「注意」の節を参照。"
 
 #. type: Plain text
 #: build/C/man2/execve.2:404
@@ -6422,14 +6422,14 @@ msgstr "Linux はスクリプトの set-user-ID と set-group-ID ビットを無
 #: build/C/man2/execve.2:561
 #, no-wrap
 msgid "execve() and EAGAIN"
-msgstr ""
+msgstr "execve() と EAGAIN"
 
 #. type: Plain text
 #: build/C/man2/execve.2:567
 msgid ""
 "A more detailed explanation of the B<EAGAIN> error that can occur (since "
 "Linux 3.1) when calling B<execve>()  is as follows."
-msgstr ""
+msgstr "B<execve>() を呼び出した際に (Linux 3.1 以降で) 起こり得る B<EAGAIN> エラーの詳細な説明を以下で行う。"
 
 #.  commit 909cc4ae86f3380152a18e2a3c44523893ee11c4
 #. type: Plain text
@@ -6442,7 +6442,7 @@ msgid ""
 "exceeds the resource limit).  From Linux 2.6.0 to 3.0, this caused the "
 "B<set*uid>()  call to fail.  (Prior to 2.6, the resource limit was not "
 "imposed on processes that changed their user IDs.)"
-msgstr ""
+msgstr "I<直前の> B<setuid>(2), B<setreuid>(2), B<setresuid>(2) の呼び出しで、 そのプロセスの実ユーザー ID が変更され、 その変更によりそのプロセスが B<RLIMIT_NPROC> リソース上限を超過してしまった場合 (すなわち、新しい実ユーザー ID に属するプロセス数が B<RLIMIT_NPROC> リソース上限を超過した場合) に、 B<EAGAIN> エラーが発生する。 Linux 2.6.0 以上 3.0 以下では、これにより B<set*uid>() の呼び出しが失敗していた。 (Linux 2.6 より前では、このリソース上限はユーザー ID を変更したプロセスには適用されていなかった。)"
 
 #. type: Plain text
 #: build/C/man2/execve.2:620
@@ -6459,7 +6459,7 @@ msgid ""
 "B<EAGAIN>.  This kernel logic ensures that the B<RLIMIT_NPROC> resource "
 "limit is still enforced for the common privileged daemon workflow"
 "\\(emnamely, B<fork>(2)  + B<set*uid>()  + B<execve>()."
-msgstr ""
+msgstr "Linux 3.1 以降では、上で説明したシナリオでは B<set*uid>() の呼び出しは失敗しない。 なぜなら、 返されたステータスの確認を行わず「呼び出し元が特権を持っている場合には」呼び出しは必ず成功するとみなしているバグがあるアプリケーションでは、セキュリティホールにつながることが非常によくあるからだ。 その代わり、 B<set*uid>() の呼び出しによる実 UID の変更は成功するが、 カーネルは B<PF_NPROC_EXCEEDED> という名前の内部フラグをセットする。 このフラグは B<RLIMIT_NPROC> リソース上限が超過したことを示す。 B<PF_NPROC_EXCEEDED> フラグがセットされていて、その後で B<execve>() が呼ばれた際にリソース上限がまだ超過していれば、 その B<execve>() の呼び出しは B<EAGAIN> エラーで失敗する。 このカーネルのロジックにより、 特権デーモンでよく行われる処理フロー、 すなわち B<fork>(2)  + B<set*uid>()  + B<execve>() に対して、前と変わらず B<RLIMIT_NPROC> リソース上限を適用できることが保証される。"
 
 #. type: Plain text
 #: build/C/man2/execve.2:636
@@ -6470,7 +6470,7 @@ msgid ""
 "succeeds and the kernel clears the B<PF_NPROC_EXCEEDED> process flag.  The "
 "flag is also cleared if a subsequent call to B<fork>(2)  by this process "
 "succeeds."
-msgstr ""
+msgstr "(B<set*uid>() と B<execve>() の呼び出しの間に、この実 UID に属する他のプロセスが終了して) 次に B<execve>() が呼び出された際にこのリソース上限が超過してなければ、 B<execve>() の呼び出しは成功し、カーネルは B<PF_NPROC_EXCEEDED> プロセスフラグをクリアする。 同じプロセスによって B<fork>(2) の呼び出しが後で行われた場合にも、このフラグはクリアされる。"
 
 #. type: SS
 #: build/C/man2/execve.2:636
index eeed627..8956bae 100644 (file)
@@ -1,3 +1,2 @@
 # pagename,#complete,#remaining,#all
-execve.2,167,6,173
 fcntl.2,195,46,241
index 550feee..3f51522 100644 (file)
 <TR><TD>utimensat.2</TD><TD>49/107</TD><TD>54.21</TD></TR>
 <TR class="over80"><TD>zdump.8</TD><TD>1/22</TD><TD>95.45</TD></TR>
 <TR><TD ALIGN="center" COLSPAN=3 BGCOLOR="Yellow"><B>unistd</B></TD></TR>
-<TR class="over80"><TD>execve.2</TD><TD>6/173</TD><TD>96.53</TD></TR>
 <TR class="over80"><TD>fcntl.2</TD><TD>46/241</TD><TD>80.91</TD></TR>
-<TR><TD COLSPAN=3>Total 86 pages</TD></TR>
+<TR><TD COLSPAN=3>Total 85 pages</TD></TR>
 </TABLE>
 </BODY></HTML>