Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2781742rwb; Thu, 29 Sep 2022 15:11:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6qdRJTe8QKdxxGYJPlJuHHnQhY2fDxQ6XaoKXIoOkAWG8faLNFZ8JckL/RigpKm17E5czp X-Received: by 2002:a17:903:2309:b0:176:de48:e940 with SMTP id d9-20020a170903230900b00176de48e940mr5568438plh.15.1664489461479; Thu, 29 Sep 2022 15:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664489461; cv=none; d=google.com; s=arc-20160816; b=WkdM9xRVIIPpQ+PKoQIP1WNNmzytJjudol2nk3vJQ896kvCbtTRHevUxtuboEMUnMv dvsrInrDXpXvjLf39GH+uqqCLfkb0kSRgwy6CoUIXpVTIq38p21Oyfh7OR4cmxIL9bf1 aE16ZVM6wGxsGAJ9Y+i+6o1ahxVCYSXhpfeD4Wx0+PMHbhWqAo6Z4lrlawd0St6oVH4F 9Rw749K+5aZY5cGJGojDtnjpJxIytTHbl15yWwgCwM6+gs02vlIgUUSxDByk+gHT3cH0 n2V5l4b9JB1mnP00JRYnoVxhSuajnONLM3dUAuBC2XvwugWQ1l67yjDRkxFs9Gqg9Q6k eEjA== 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 :dkim-signature; bh=K7HkydYtQjNwz29N2ZiCUMTHJkR3b/p2rE+Pb09h/o4=; b=CjORaKekMkepPbJeATpWQsFqxfJyiepI3pNYzRh7/LAcngE1iBZA1mb7BmBKt7/0lJ xyXziVR5t6BmMI8wwkE+WkHf3B5YcRNt2+VnbS/gCVmFxdSx7z/dMTdfOjt61l6797Sr pV7fXa3ty83qQ0zaP9TP+G48OQ0MqrJrHtQGLp05itMs1J4AHv13Mfz/lc84XeBFjzC2 9TDGnRN4D076GmrgUIskTXrQe0KFkeu1/bIOCdzbiHrO5laexzu6+Rri+JLYNVhVkjcJ NaJr9Mkf+lnInTsvG41smOTLFzF+NB2sUjVnbn2V+hRNz2fyRMY9X0vhmes/1Jh4HXr2 lemg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=CcSGLj4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v3-20020a170902ca8300b0017a0c197f3fsi789106pld.335.2022.09.29.15.10.46; Thu, 29 Sep 2022 15:11:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=CcSGLj4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229952AbiI2V13 (ORCPT + 99 others); Thu, 29 Sep 2022 17:27:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiI2V1X (ORCPT ); Thu, 29 Sep 2022 17:27:23 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A8AB140F20; Thu, 29 Sep 2022 14:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=K7HkydYtQjNwz29N2ZiCUMTHJkR3b/p2rE+Pb09h/o4=; b=CcSGLj4sMlhvqOt1nNry4YXbLV 5jUAawuSHfkDPsMHZXyM7tQ1XdWFhbEfsewPxBVdViE7Q/I9Gn0MQoV/fdRmpxgLrLJiGQj1iApIt eleBkwN0r3UpZRVYwwn7VB+328R4JzinwjtF45pv8JwwNGaP5mDz3unhJwwoIbf6TMdmEDyea/JmV 4e3S/jaxfbCtFwp4ugft8Ck256yF6+Yj8WwdbTw6l8QjyAlM+lro0A1YuH6PgaFfbidVS/UNpWwnr +hJ0XdhrEbwkkzm9NwOOZQOhfjGcAR1YVv8+5a2OkFOguNyUx7RtWJrMxrIodNXHrNsfDDYe6iUDh pZ5uDLXA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1oe13v-00566n-2a; Thu, 29 Sep 2022 21:27:19 +0000 Date: Thu, 29 Sep 2022 22:27:19 +0100 From: Al Viro To: Linus Torvalds Cc: David Laight , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "Eric W. Biederman" , "Serge E. Hallyn" Subject: Re: [PATCH 3/4] proc: Point /proc/net at /proc/thread-self/net instead of /proc/self/net Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 29, 2022 at 10:21:04PM +0100, Al Viro wrote: > On Thu, Sep 29, 2022 at 02:13:57PM -0700, Linus Torvalds wrote: > > On Thu, Sep 29, 2022 at 12:34 PM Al Viro wrote: > > > > > > Apparmor takes mount+dentry and turns that into pathname. Then acts > > > upon the resulting string. *AFTER* the original had been resolved. > > > > Ok. So it would have to act like a bind mount. > > > > Which is probably not too bad. > > > > In fact, maybe it would be ok for this to act like a hardlink and just > > fill in the inode - not safe for a filesystem in general due to the > > whole rename loop issue, but for /proc it might be fine? > > _Which_ hardlink? > > Linus, where in dentry tree would you want it to be seen? Because > apparmor profile wants /proc/net/dev to land at /proc//net/dev > and will fail with anything else. > > Do you really want multiple dentries with the same name in the same > parent, refering to different directory inodes with different contents? > > And that's different inodes with different contents - David's complaint > is precisely about seeing the same thing for all threads and apparmor > issue is with *NOT* seeing each of those things at the same location. Put it another way: David: when I'm opening /proc/net/whatever, I want its contents to match this thread's netns, not that of some other thread. dhclient+apparmor: whatever you get from /proc/net/dev, it would better be at /proc//net/dev, no matter which thread you happen to be. It's not that we want to see the same thing in several places; it's that we want to see *different* things in the same place. Opposite to what hardlinks or bindings would be about.