lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2H=LoW5apWNxbqda+JAa33R=tqc7RK=2Uv7J_Xpy+bgg@mail.gmail.com>
Date:   Thu, 15 Mar 2018 21:11:27 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Dominik Brodowski <linux@...inikbrodowski.net>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Andy Lutomirski <luto@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 14/36] fs: add ksys_mount() helper; remove in-kernel
 calls to sys_mount()

On Thu, Mar 15, 2018 at 8:05 PM, Dominik Brodowski
<linux@...inikbrodowski.net> wrote:
> Using this helper allows us to avoid the in-kernel calls to the sys_mount()
> syscall.
>
> Cc: Alexander Viro <viro@...iv.linux.org.uk>
> Signed-off-by: Dominik Brodowski <linux@...inikbrodowski.net>

> diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
> index 50025d7959cb..4afb04686c8e 100644
> --- a/drivers/base/devtmpfs.c
> +++ b/drivers/base/devtmpfs.c
> @@ -356,7 +356,8 @@ int devtmpfs_mount(const char *mntdir)
>         if (!thread)
>                 return 0;
>
> -       err = sys_mount("devtmpfs", (char *)mntdir, "devtmpfs", MS_SILENT, NULL);
> +       err = ksys_mount("devtmpfs", (char *)mntdir, "devtmpfs", MS_SILENT,
> +                        NULL);
>         if (err)
>                 printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
>         else
> @@ -382,7 +383,7 @@ static int devtmpfsd(void *p)
>         *err = sys_unshare(CLONE_NEWNS);
>         if (*err)
>                 goto out;
> -       *err = sys_mount("devtmpfs", "/", "devtmpfs", MS_SILENT, options);
> +       *err = ksys_mount("devtmpfs", "/", "devtmpfs", MS_SILENT, options);
>         if (*err)
>                 goto out;
>         sys_chdir("/.."); /* will traverse into overmounted root */

Shouldn't the callers of sys_mount just call do_mount() instead?

As I understand it, sys_mount is already a wrapper around do_mount()
that copies its arguments from user space, but we don't need that
when called from inside the kernel.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ