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] [day] [month] [year] [list]
Date:	Sun, 14 Sep 2014 19:12:59 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Seunghun Lee <waydi1@...il.com>
Cc:	rth@...ddle.net, ink@...assic.park.msu.ru, mattst88@...il.com,
	jlayton@...chiereds.net, bfields@...ldses.org,
	linux-alpha@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] vfs: move getname() from callers to do_mount()

On Sun, Sep 14, 2014 at 10:15:10PM +0900, Seunghun Lee wrote:
> It would make more sense to pass char __user * instead of
> char * in callers of do_mount() and do getname() inside do_mount().
> 
> Suggested-by: Al Viro <viro@...IV.linux.org.uk>
> Signed-off-by: Seunghun Lee <waydi1@...il.com>

Applied with one modification: this getname/kern_path/putname is equivalent to
user_path(dir_name, &path) and do_mount() becomes simpler if we use that
instead of not-quite-opencoding it.

Beginning of do_mount() becomes simply
        /* Discard magic */
        if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
                flags &= ~MS_MGC_MSK;

        /* Basic sanity checks */
        if (data_page)
                ((char *)data_page)[PAGE_SIZE - 1] = 0;

        /* ... and get the mountpoint */
        retval = user_path(dir_name, &path);
        if (retval)
                return retval;
that way, and there's no struct filename * to discard on exit; getname and
putname are done inside user_path().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists