lkml.org 
[lkml]   [2018]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 17/36] fs: add ksys_chroot() helper; remove-in kernel calls to sys_chroot()
On Thu, Mar 15, 2018 at 8:05 PM, Dominik Brodowski
<linux@dominikbrodowski.net> wrote:
> Using this helper allows us to avoid the in-kernel calls to the sys_chroot()
> syscall.
>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> ---
> drivers/base/devtmpfs.c | 2 +-
> fs/open.c | 7 ++++++-
> include/linux/syscalls.h | 1 +
> init/do_mounts.c | 2 +-
> init/do_mounts_initrd.c | 4 ++--
> 5 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
> index 4afb04686c8e..5743f04014ca 100644
> --- a/drivers/base/devtmpfs.c
> +++ b/drivers/base/devtmpfs.c
> @@ -387,7 +387,7 @@ static int devtmpfsd(void *p)
> if (*err)
> goto out;
> sys_chdir("/.."); /* will traverse into overmounted root */
> - sys_chroot(".");
> + ksys_chroot(".");
> complete(&setup_done);
> while (1) {
> spin_lock(&req_lock);

Could this be done using kern_path()/set_fs_root() instead so we
avoid the __user pointer?

Arnd

\
 
 \ /
  Last update: 2018-03-15 21:44    [W:0.518 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site