Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp7187112ybf; Fri, 6 Mar 2020 12:06:17 -0800 (PST) X-Google-Smtp-Source: ADFU+vttUJGc80EkZ8TOMKlB/eMqC4RyQ9raJPVcSXC3awg7owHw3JDF1oWFFVHXCMkueM8HzBnw X-Received: by 2002:aca:55c4:: with SMTP id j187mr803825oib.114.1583525176967; Fri, 06 Mar 2020 12:06:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583525176; cv=none; d=google.com; s=arc-20160816; b=PMsANAPxOK1LIZeXSWajNSHhQ7fwqO7zuhMIwEN/G6y2ankd9srO0ZLF/HRZNI53gC 0xtzC0ogQQvHjui1Fpx3O0J89DaegLzAwaVyaZ+6Bs1PG1peQVoHS2puqf8Npznw5Ocp XDv4Ck0jClMxiS5mZSUYljjqqHd1dNE7Vz8Ass86sWc2oT+8xTWRK/kcR5RNsQWxMvef H0098C4WKO6SgWfLAeMTgl3eEKlXIL+OD3cg1HK0NANg10auqGnDdl1+H8SkDQIGflb3 S0ofgfXneaMTzsPbTRPMRAePbkReSuAZ4h9CwUmTgPrb/oPVPueATbOk/vtVZLhT5PsO +JFw== 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=n8BipNk1UUpmtsto1Zsqq7GLXIgubhMEr09QG9kQlII=; b=p852LfxPA+xOG792cXkWR0J5Re/ChLZoehaXCq/jl/zo1EENWz9mBzuZt1wRb/FVcW MoheSjDALSKgJy4KsNqf9nM3IjmVcF4oxY5kXJNcQ6gyOxBfgqvIbLgm/d64Tn78M4Gc hoImHLvwW4e0Sbt2qTZ7EFjJzVs/+U3qNsFBQnnJIlGb5/1nAqlXc34xzv4dJUEg/gyz sRU+x1eTC6nqTZ3zZm8jKs4RAWShXi/ptvlX+6oVA8jjhoWxftqIbwafr4LTe6es6YAe FYTapoYq9YBLTnplhh2GFVCWM1BYJduoReO05lX9CEk3JQ+cTQbOdl1+6irokB6kpsS+ 0TJA== 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 d15si238926oic.38.2020.03.06.12.06.05; Fri, 06 Mar 2020 12:06:16 -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 S1726485AbgCFUFd (ORCPT + 99 others); Fri, 6 Mar 2020 15:05:33 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:38560 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbgCFUFc (ORCPT ); Fri, 6 Mar 2020 15:05:32 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAJDm-006Sl9-H9; Fri, 06 Mar 2020 20:05:22 +0000 Date: Fri, 6 Mar 2020 20:05:22 +0000 From: Al Viro To: Miklos Szeredi Cc: Ian Kent , David Howells , Christian Brauner , James Bottomley , Steven Whitehouse , Miklos Szeredi , Christian Brauner , Jann Horn , "Darrick J. Wong" , Linux API , linux-fsdevel , lkml , Greg Kroah-Hartman Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] Message-ID: <20200306200522.GA23230@ZenIV.linux.org.uk> References: <1582644535.3361.8.camel@HansenPartnership.com> <20200228155244.k4h4hz3dqhl7q7ks@wittgenstein> <107666.1582907766@warthog.procyon.org.uk> <0403cda7345e34c800eec8e2870a1917a8c07e5c.camel@themaw.net> <20200306162549.GA28467@miu.piliscsaba.redhat.com> <20200306194322.GY23230@ZenIV.linux.org.uk> <20200306195823.GZ23230@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200306195823.GZ23230@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 06, 2020 at 07:58:23PM +0000, Al Viro wrote: > On Fri, Mar 06, 2020 at 07:43:22PM +0000, Al Viro wrote: > > On Fri, Mar 06, 2020 at 05:25:49PM +0100, Miklos Szeredi wrote: > > > On Tue, Mar 03, 2020 at 08:46:09AM +0100, Miklos Szeredi wrote: > > > > > > > > I'm doing a patch. Let's see how it fares in the face of all these > > > > preconceptions. > > > > > > Here's a first cut. Doesn't yet have superblock info, just mount info. > > > Probably has rough edges, but appears to work. > > > > For starters, you have just made namespace_sem held over copy_to_user(). > > This is not going to fly. > > In case if the above is too terse: you grab your mutex while under > namespace_sem (see attach_recursive_mnt()); the same mutex is held > while calling dir_emit(). Which can (and normally does) copy data > to userland-supplied buffer. > > NAK for that reason alone, and to be honest I had been too busy > suppressing the gag reflex to read and comment any deeper. > > I really hate that approach, in case it's not clear from the above. > To the degree that I don't trust myself to filter out the obscenities > if I try to comment on it right now. > > The only blocking thing we can afford under namespace_sem is GFP_KERNEL > allocation. Incidentally, attach_recursive_mnt() only gets you the root(s) of attached tree(s); try mount --rbind and see how much you've missed.