Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3949665ybl; Mon, 13 Jan 2020 05:32:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzKr0/5im83LMQrrFjMQe55jP+lUgoKuKNGJc6lBuoXqZUqUOhNO/LQ/zw8mDUiXfPRzfqI X-Received: by 2002:a9d:806:: with SMTP id 6mr12424059oty.90.1578922329994; Mon, 13 Jan 2020 05:32:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578922329; cv=none; d=google.com; s=arc-20160816; b=0yJT+BNpacnYEP0dPIR3zNTxF1XgJRSVxeHTzaz5sO8vQIHfOhyxsxlYUI+SW380IN fU5DLu7FNunWPB8WbitBPGDbC90wegQAp4utFFZAia8+0O4DBuTse/89QWmHziPSb3aC 65UTu+lnhed2N1ooUiRpXe1mhpHKQrdIVg69c+wEJDd7KmeYCMEJ+S0AuKsviXAFo85l THjpEOgI4SaeQntkDEntoTyaWtxOYIH8Eh+5xeHjjdIAlRtjdgdAWr9y0mUz7BiRBdrZ fOQjbBQPtzj23w6r8PVTL6O+5Sm0/F4a7ar9kRdKi9GoZlr3AafJjbYAScs7yAN+s6w0 8pwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=PtjXCVTL9NoXLMlxNYTRdlCtfBhkRheSWCj2Zws6Ess=; b=sHqqlVTvv7s9JCauLblV0kOcfpJPBiM1pzDRMShdKefAgRHnivFSed029UYfaPygop pRLA832broV6hlKAgAfdQ5/JTpZ6MvoJq3uXuug63DSmH15Y5b74RZoggoal6xEF+F8b FqG1mc7ip9Tf8fFuyn64xQEROUDnoR9oCRJnCxccMTPQVJIjVLL9zVhe1VvHJ98yfvIT CUjFXBd1nx+IRLtAJzaVxoo8lCmJjP3iq0XJWxAvbwUUGfvdpWj64ufFjy0YzE73OaXq MOEKTEVdd0PiP3UmT+hhicow3zX3ZcjmPJruZsqL08MIjbGvpudsPvhr8cvlIYpBFiFh TWVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si5889229oie.98.2020.01.13.05.31.58; Mon, 13 Jan 2020 05:32:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728760AbgAMNbG (ORCPT + 99 others); Mon, 13 Jan 2020 08:31:06 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:50722 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbgAMNbF (ORCPT ); Mon, 13 Jan 2020 08:31:05 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqznr-007J3N-Qf; Mon, 13 Jan 2020 13:30:47 +0000 Date: Mon, 13 Jan 2020 13:30:47 +0000 From: Al Viro To: Ian Kent Cc: Aleksa Sarai , David Howells , Eric Biederman , Linus Torvalds , stable@vger.kernel.org, Christian Brauner , Serge Hallyn , dev@opencontainers.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 0/1] mount: universally disallow mounting over symlinks Message-ID: <20200113133047.GR8904@ZenIV.linux.org.uk> References: <20200101030815.GA17593@ZenIV.linux.org.uk> <20200101144407.ugjwzk7zxrucaa6a@yavin.dot.cyphar.com> <20200101234009.GB8904@ZenIV.linux.org.uk> <20200102035920.dsycgxnb6ba2jhz2@yavin.dot.cyphar.com> <20200103014901.GC8904@ZenIV.linux.org.uk> <20200110231945.GL8904@ZenIV.linux.org.uk> <20200113035407.GQ8904@ZenIV.linux.org.uk> <41c535d689530f3715f21cd25074eb61e825a5f6.camel@themaw.net> <58f9894e51a00ad2a4ac3d4122bf29e7cb6c0d54.camel@themaw.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58f9894e51a00ad2a4ac3d4122bf29e7cb6c0d54.camel@themaw.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 13, 2020 at 02:03:00PM +0800, Ian Kent wrote: > Oh wait, for systemd I was actually looking at: > https://github.com/systemd/systemd/blob/master/src/shared/switch-root.c > > > > > Mind you, that's not the actual systemd repo. either I probably > > need to look a lot deeper (and at the actual systemd repo) to > > work out what's actually being called. > > > > > Sigh... Guess I'll have to dig that Fedora KVM image out and > > > try to see what it's about... ;-/ Here comes a couple of hours > > > of build... D'oh... And yes, that would've been a bisect hazard - switch to path_lookupat() later in the series gets rid of that. Incremental (to be foldede, of course): diff --git a/fs/namei.c b/fs/namei.c index 1793661c3342..204677c37751 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2634,7 +2634,7 @@ path_mountpoint(struct nameidata *nd, unsigned flags, struct path *path) (err = lookup_last(nd)) > 0) { s = trailing_symlink(nd); } - if (!err) + if (!err && (nd->flags & LOOKUP_RCU)) err = unlazy_walk(nd); if (!err) err = handle_lookup_down(nd);