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]
Date:   Thu, 15 Mar 2018 21:30:58 +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 30/36] fs: add do_linkat() helper and ksys_link()
 wrapper; remove in-kernel calls to syscall

On Thu, Mar 15, 2018 at 8:05 PM, Dominik Brodowski
<linux@...inikbrodowski.net> wrote:
>
>   */
> -SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
> -               int, newdfd, const char __user *, newname, int, flags)
> +int do_linkat(int olddfd, const char __user *oldname, int newdfd,
> +             const char __user *newname, int flags)
>  {
>         struct dentry *new_dentry;
>         struct path old_path, new_path;

For consistency with other do_*() functions, I think it would be nice
to make this one not take a __user pointer either. However, I
have no idea how to do that without making the common case worse.

> --- a/init/initramfs.c
> +++ b/init/initramfs.c
> @@ -306,7 +306,7 @@ static int __init maybe_link(void)
>         if (nlink >= 2) {
>                 char *old = find_link(major, minor, ino, mode, collected);
>                 if (old)
> -                       return (sys_link(old, collected) < 0) ? -1 : 1;
> +                       return (ksys_link(old, collected) < 0) ? -1 : 1;
>         }
>         return 0;
>  }

Since this is the only caller outside of fs/namei.c, maybe it can be
changed to use vfs_link() instead? That might still be a larger rework
than you want to do.

        Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ