From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman) Subject: Re: [PATCH review 0/4] Loopback mount escape fixes Date: Thu, 09 Apr 2015 14:01:15 -0500 Message-ID: <87egnt5dok.fsf@x220.int.ebiederm.org> References: <871tncuaf6.fsf@x220.int.ebiederm.org> <87mw5xq7lt.fsf@x220.int.ebiederm.org> <87a8yqou41.fsf_-_@x220.int.ebiederm.org> <874moq9oyb.fsf_-_@x220.int.ebiederm.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Andrey Vagin , Richard Weinberger , Andy Lutomirski , Al Viro , linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jann Horn , Willy Tarreau To: Linux Containers Return-path: In-Reply-To: <874moq9oyb.fsf_-_-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org> (Eric W. Biederman's message of "Wed, 08 Apr 2015 18:31:56 -0500") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org Al. Do you want involvement in any of these patches? If not I will move them in the direction of linux-next and Linus. I expect they are just interesting enough that I don't want to send them as bug fixes during rc-late. The feedback from the review I have recevied has been incorporated into: git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git for-testing While I have energy I would like to push these things and get these issues fixed. Eric ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman) writes: > After the last round of feedback I sat down and played with my fix > for the fact that a strategically placed rename, ".." on bind mounts > go up past the root of the bind mount. > > The code better handles the escaped directory returning into it's bind > mount, and is now roughly a constant factor cost in all cases from what > the code costs without the fix. > > So I think I have found a better tradeoff between fixing this bug and > not slowing down path name lookups in the common case. > > These fixes are against on v4.0-rc6. > > For those who like to see everything in a single tree the code is at: > > git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git for-testing > > Eric W. Biederman (4): > mnt: Track which mounts use a dentry as root. > vfs: Test for and handle paths that are unreachable from their mnt_root > vfs: Handle mounts whose parents are unreachable from their mountpoint > vfs: Do not allow escaping from bind mounts. > > fs/dcache.c | 82 +++++++++++++++++++++++++++--- > fs/internal.h | 2 + > fs/mount.h | 6 +++ > fs/namei.c | 57 +++++++++++++++++---- > fs/namespace.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++-- > include/linux/dcache.h | 13 +++++ > include/linux/namei.h | 2 + > 7 files changed, 277 insertions(+), 20 deletions(-)