[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190701154317.GB790@sol.localdomain>
Date: Mon, 1 Jul 2019 08:43:17 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: linux-fsdevel@...r.kernel.org, David Howells <dhowells@...hat.com>,
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Re: [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
Powered by blists - more mailing lists