Slide 11
Slide 11 text
reboot システムコール内の処理
コンテナ内から reboot(2) システムコールを発行したときの処理が追加されたあとのコー
ド(kernel/reboot.c 700 行目(6.1kernel)
)
。
SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
void __user *, arg)
{
/* 現在の PID Namespace を取得 */
struct pid_namespace *pid_ns = task_active_pid_ns(current);
/* reboot() を実行する権限があるかチェック */
if (!ns_capable(pid_ns->user_ns, CAP_SYS_BOOT))
return -EPERM;
:(略)
/* PID Namespace 内のリブート処理 */
ret = reboot_pid_ns(pid_ns, cmd);
:(略)
/* ホストのリブート処理 */
:(略)
(コメントは私が入れています)
9/12