linux:kernel:cgroup:cgroup_management_daemon

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:kernel:cgroup:cgroup_management_daemon [2013/12/06 09:05] tenforwardlinux:kernel:cgroup:cgroup_management_daemon [2013/12/11 11:11] (現在) tenforward
行 100: 行 100:
     cgroup に対する特権はチェックしなければならない.r は,もし A が r     cgroup に対する特権はチェックしなければならない.r は,もし A が r
     の uid の所有である場合は A に対する特権を持つと考えられている.も     の uid の所有である場合は A に対する特権を持つと考えられている.も
-    しくは A のオーナーは r のユーザ名前空間にマップされ,r はそのユー +    しくはもし A のオーナーは r のユーザ名前空間にマップされている場合 
-    ザ名前空間内では root となる.+    r はそのユーザ名前空間内では root となる.
          
   . The client request may pertain a victim task v, which may be moved   . The client request may pertain a victim task v, which may be moved
行 109: 行 109:
     and r is root in its userns.  Or if r and v have the same uid     and r is root in its userns.  Or if r and v have the same uid
     and v is mapped in r's pid namespace.     and v is mapped in r's pid namespace.
 +    
 +  * クライアントリクエストは,新しいグループに移動する対象のタスク v に
 +    関係するかもしれない.この場合,両方の cgroup に対する r の特権と v
 +    はチェックする必要がある.もし v が r の PID 名前空間にマップされて
 +    おり,v の uid が r のユーザ名前空間にマップされており,r がそのユー
 +    ザ名前空間内で root であるのなら v に対する特権を持っていると考えら
 +    れる.もしくは,もし r と v が同じ uid で,v が r の PID 名前空間に
 +    マップされている場合も.
 + 
   . r's credentials will be taken from socket's peercred, ensuring that   . r's credentials will be taken from socket's peercred, ensuring that
     pid and uid are translated.     pid and uid are translated.
 +
 +  * r の認証情報はソケットの peercred から継承し,pid と uid が変換され
 +    ることを保証する.
 +
   . r passes PID(v) as a SCM_CREDENTIAL, so that cgmanager receives the   . r passes PID(v) as a SCM_CREDENTIAL, so that cgmanager receives the
     translated global pid.  It will then read UID(v) from /proc/PID(v)/status,     translated global pid.  It will then read UID(v) from /proc/PID(v)/status,
     which is the global uid, and check /proc/PID(r)/uid_map to see whether     which is the global uid, and check /proc/PID(r)/uid_map to see whether
     UID is mapped there.     UID is mapped there.
 +
 +  * r は PID(v) を SCM_CREDENTIAL として渡す.そして cgmanager は変換
 +    されたグローバルな pid を受け取る.そして,/proc/PID(v)/status か
 +    ら UID(v) を読み取る.これはグローバルな uid である.そして,UID
 +    がそこにマップされているかどうかを見るために /proc/PID(r)/uid_map
 +    をチェックする.
 +
   . dbus-send can be enhanced to send a pid as SCM_CREDENTIAL to have   . dbus-send can be enhanced to send a pid as SCM_CREDENTIAL to have
     the kernel translate it for the reader.  Only 'move task v to cgroup     the kernel translate it for the reader.  Only 'move task v to cgroup
     A' will require a SCM_CREDENTIAL to be sent.     A' will require a SCM_CREDENTIAL to be sent.
 +    
 +  * dbus-send は,Reader のためにカーネルに (TODO: 何を?) 変換させるた
 +    めに SCM_CREDENTIAL として pid を送るように改良することが可能であ
 +    る.
 +
  
 Privilege requirements by action: Privilege requirements by action:
     * Requestor of an action (r) over a socket may only make     * Requestor of an action (r) over a socket may only make
       changes to cgroups over which it has privilege.       changes to cgroups over which it has privilege.
 +
 +    * ソケットを通してのアクション (r) の要求元は,持っている特権を通し
 +      て cgroup に変更を加えるだけだけかもしれない.
 +
     * Requestors may be limited to a certain #/depth of cgroups     * Requestors may be limited to a certain #/depth of cgroups
       (to limit memory usage) - DEFER?       (to limit memory usage) - DEFER?
 +
 +    * 要求元は (メモリ消費を制限するために) cgroup の深さをある程度に制
 +      限するかもしれない - 保留?
 +
     * Cgroup hierarchy is responsible for resource limits     * Cgroup hierarchy is responsible for resource limits
 +
 +    * cgroup の階層構造は,リソース制限に対して責任を持つ
 +
     * A requestor must either be uid 0 in its userns with victim mapped     * A requestor must either be uid 0 in its userns with victim mapped
       ito its userns, or the same uid and in same/ancestor pidns as the       ito its userns, or the same uid and in same/ancestor pidns as the
       victim       victim
 +      
 +    * 要求元は,その userns にマップされた対象と共に,その userns 内で
 +      uid 0 でなければならないか,もしくは対象と同じか同じ祖先の pidns
 +      内にいて,同じ uid でなければならない.
 +      
     * If r requests creation of cgroup '/x', /x will be interpreted     * If r requests creation of cgroup '/x', /x will be interpreted
       as relative to r's cgroup.  r cannot make changes to cgroups not       as relative to r's cgroup.  r cannot make changes to cgroups not
       under its own current cgroup.       under its own current cgroup.
 +
 +    * r が cgroup /x の作成をリクエストした場合,/x は r の cgroup か
 +      らの相対パスに変換される.r は自身のカレント cgroup 以下の
 +      cgroup に変更を加えることはできない.
 +
     * If r is not in the initial user_ns, then it may not change settings     * If r is not in the initial user_ns, then it may not change settings
       in its own cgroup, only descendants.  (Not strictly necessary -       in its own cgroup, only descendants.  (Not strictly necessary -
       we could require the use of extra cgroups when wanted, as lxc does       we could require the use of extra cgroups when wanted, as lxc does
       currently)       currently)
 +
 +    * r が初期 userns 内にいない場合,自身の cgroup 内の設定を変えられ
 +      ず,子孫だけを変えられるかもしれない (厳密に必要ではない.現在
 +      lxc でやっているように,必要な時に特別な cgroup の使用が必要にな
 +      ることもあり得る)
 +
     * If r requests creation of cgroup '/x', it must have write access     * If r requests creation of cgroup '/x', it must have write access
       to its own cgroup  (not strictly necessary)       to its own cgroup  (not strictly necessary)
 +
 +    * r が cgroup /x の作成をリクエストした場合,自身の cgroup に対す
 +      る書き込み権を持っていなければならない (厳密に必要ではない)
 +
     * If r requests chown of cgroup /x to uid Y, Y is passed in a     * If r requests chown of cgroup /x to uid Y, Y is passed in a
       ucred over the unix socket, and therefore translated to init       ucred over the unix socket, and therefore translated to init
       userns.       userns.
 +
 +    * r が cgroup /x に対して uid Y への chown をリクエストした場合,Y
 +      は Unix socket 経由で ucred に渡される.そのため,init userns に
 +      変換される.
 +
     * if r requests setting a limit under /x, then     * if r requests setting a limit under /x, then
       . either r must be root in its own userns, and UID(/x) be mapped       . either r must be root in its own userns, and UID(/x) be mapped
行 150: 行 211:
         (see devices.allow/deny).  Further we need to support older kernels         (see devices.allow/deny).  Further we need to support older kernels
         which don't support setns for pid.         which don't support setns for pid.
 +
 +    * r が /x 以下の制限を設定するリクエストをした場合,
 +      - r は自身の userns で root であり,UID(/x) がその userns 内でマッ
 +        ピングされていなければならないか,UID(r) == UID(/x) でなければ
 +        ならないかのどちらかである.
 +      - /x は / であってはならない (厳密に必要ではない.全てのユーザが
 +        / が cgroup の特別なレイヤーであることを知っている)
 +      - setns(UIDNS(r)) が動かない.これはカーネル内の capable() チェッ
 +        クを満たさないためである.それゆえ,特権チェックを我々自身が行
 +        う必要がある.そして,ホストの root ユーザとして書き込みを行う
 +        (see devices.allow/deny).さらに,我々は pid に対する setns が
 +        できない古いカーネルをサポートする必要がある.
 +
     * If r requests action on victim V, it passes V's pid in a ucred,     * If r requests action on victim V, it passes V's pid in a ucred,
       so that gets translated.       so that gets translated.
  • linux/kernel/cgroup/cgroup_management_daemon.1386320715.txt.gz
  • 最終更新: 2013/12/06 09:05
  • by tenforward