OSDN Git Service

Releases pages updated/added in LDP v3.76
[linuxjm/LDP_man-pages.git] / release / man2 / execve.2
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