From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27EB3C4332F for ; Thu, 29 Sep 2022 21:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbiI2VVL (ORCPT ); Thu, 29 Sep 2022 17:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbiI2VVI (ORCPT ); Thu, 29 Sep 2022 17:21:08 -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 18D50792DA; Thu, 29 Sep 2022 14:21:07 -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=82CVBJMMg98pUNlHUvfZc77iRO0SkRHuyncOXZOobb0=; b=gNmVA9qql9f+jgH9jCCrya+yQ9 iPMje2hMZ1ZSzQr8S2Ien0bIoiMdJCUAi7nOfsPyYCZ83wCWoCBXlR7gZFEHLM15XWGdWHtkcp1ZH ZzQ7iAMDAqU8MyYl23SGseHPoZl/lSnOycCO4PneM5k9ZDWwuYlX3Uo/7dhpX7F1K28PhZHOaRpPh C6i4et6apdoYHo/rbilXZz5lVFtuwRHVKbjLCZY+EKJxWaNT4qK+gRG8bvw2rc096AFjclk4brjxW JkOuxbko4XUznNtchVGgJ9Sx0JJuU9vLLEjjfnxU5ykSWez+ZEdM1nw2KRRqjfsaT6IosmeE7Qcew zv+qkzLg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1oe0xs-00562S-0g; Thu, 29 Sep 2022 21:21:04 +0000 Date: Thu, 29 Sep 2022 22:21:04 +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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.