Re: [PATCH v2 1/2] fs: Improve and simplify copy_mount_options

Linus Torvalds
2016-06-16T00:42:35Z

On Wed, Jun 15, 2016 at 2:01 PM, Andy Lutomirski <luto@amacapital.net> wrote:
>
> devtmpfsd does:
>
> *err = sys_mount("devtmpfs", "/", "devtmpfs", MS_SILENT, options);
>
> where options points to the kernel stack. This is bad. do_mount_root
> is similarly broken.
>
> Is there any reason that these things use sys_mount instead of do_mount?

Not that I can see. But maybe copy_mount_options could also check for
KERNEL_DS, and use a strncpy instead of a copy_from_user() for that
case?

Linus