On Thu, Mar 15, 2018 at 8:05 PM, Dominik Brodowski <li...@dominikbrodowski.net> wrote: > Using this helper allows us to avoid the in-kernel calls to the sys_chroot() > syscall. > > Cc: Alexander Viro <v...@zeniv.linux.org.uk> > Signed-off-by: Dominik Brodowski <li...@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