lkml.org 
[lkml]   [2019]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vfs: move_mount: reject moving kernel internal mounts
On Mon, Jul 01, 2019 at 02:08:48AM +0100, Al Viro wrote:
>
> Let's reorder that a bit:
> /* The mountpoint must be in our namespace. */
> if (!check_mnt(p))
> goto out;
>
> /* The thing moved must be mounted... */
> if (!is_mounted(old_path->mnt))
> goto out;
>
> /* ... and either ours or the root of anon namespace */
> if (!(attached ? check_mnt(old) : is_anon_ns(ns)))
> goto out;
>
> IMO that looks saner and all it costs us is a redundant check
> in attached case. Objections?

Looks good to me.

- Eric

\
 
 \ /
  Last update: 2019-07-01 17:44    [W:0.116 / U:6.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site