浏览代码

vfs: Allow chroot if you have CAP_SYS_CHROOT in your user namespace

Once you are confined to a user namespace applications can not gain
privilege and escape the user namespace so there is no longer a reason
to restrict chroot.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Eric W. Biederman 13 年之前
父节点
当前提交
a85fb273c9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/open.c

+ 1 - 1
fs/open.c

@@ -435,7 +435,7 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename)
 		goto dput_and_out;
 		goto dput_and_out;
 
 
 	error = -EPERM;
 	error = -EPERM;
-	if (!capable(CAP_SYS_CHROOT))
+	if (!nsown_capable(CAP_SYS_CHROOT))
 		goto dput_and_out;
 		goto dput_and_out;
 	error = security_path_chroot(&path);
 	error = security_path_chroot(&path);
 	if (error)
 	if (error)