Re: [PATCH v2 17/36] fs: add ksys_chroot() helper; remove-in kernel calls to sys_chroot()

2018-03-17 Thread Dominik Brodowski
Arnd, Christoph, On Thu, Mar 15, 2018 at 09:44:24PM +0100, Arnd Bergmann wrote: > > 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 devt

Re: [PATCH v2 17/36] fs: add ksys_chroot() helper; remove-in kernel calls to sys_chroot()

2018-03-16 Thread Christoph Hellwig
> > + 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? Agreed. Especially as we don't need any of the permission checks her

Re: [PATCH v2 17/36] fs: add ksys_chroot() helper; remove-in kernel calls to sys_chroot()

2018-03-15 Thread Arnd Bergmann
On Thu, Mar 15, 2018 at 8:05 PM, Dominik Brodowski wrote: > Using this helper allows us to avoid the in-kernel calls to the sys_chroot() > syscall. > > Cc: Alexander Viro > Signed-off-by: Dominik Brodowski > --- > drivers/base/devtmpfs.c | 2 +- > fs/open.c| 7 ++- > includ

[PATCH v2 17/36] fs: add ksys_chroot() helper; remove-in kernel calls to sys_chroot()

2018-03-15 Thread Dominik Brodowski
Using this helper allows us to avoid the in-kernel calls to the sys_chroot() syscall. Cc: Alexander Viro Signed-off-by: Dominik Brodowski --- drivers/base/devtmpfs.c | 2 +- fs/open.c| 7 ++- include/linux/syscalls.h | 1 + init/do_mounts.c | 2 +- init/do_mounts_in