Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2640799rwb; Thu, 29 Sep 2022 12:57:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Yc03lSucY49isLeDUSuOyq6JDW9WFunT/CdzPyj3ralcQoDtZYaByUUk0Q5wFSJijcPQC X-Received: by 2002:a17:907:969e:b0:782:6b92:6b1f with SMTP id hd30-20020a170907969e00b007826b926b1fmr3805908ejc.140.1664481458650; Thu, 29 Sep 2022 12:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664481458; cv=none; d=google.com; s=arc-20160816; b=C1f9ArttUMSPfgt0d1g0fl1xrL91EZccanaIuGiry0SiTyU2KqKtjCFIyoTA0nh51+ 8bvaamwV4JEOJLDdmP7ScWP6z9DQw2Z5ziU/nfZqAhFv83/D8PE4HFpP2urh623zeWnM 3PXT27THPu6l3hw22GJUrcVGKiEtIw9d+WbAjDJanql72ZzQcJsUQ15uaYXVNaCJAOcM WQH0WkU0wqY2oFvxFRNRKRTUS1dLK6Wpm2DeY9IIUOFD6H1KdZuVjp1Q3aaift3GMhlE f+rr9s/8ib+bLSkxmyFxB7pWfgV9ByNHlYZjCS4WsSoBAtxu2+4drZa7fxBLFzcs6Z8S IGZA== 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=/P0dMVsN1isqnLkFGaEvl0LKDg5OiTgpL3SenF9SLsk=; b=GqL0qj5wdtUSShyFJ/UfdehtZI8ATb/JcihT12c/Fax7rWR8rhurm4ycS0nVEPTQ0d XqD1Mpvl3gTlfozrjNGikG8SCz49K7pjB4SW6MDKtQvw7h5sTcWhZOmAb/zLqvlAeXux +CO1rDC+cTgyL4SX5C+I/CwqDqlAS+jlsOkuLXYv9s5xzO4TO8hJCx16gQzMQNk32kNw C7O8eh/PM4M3yVSBu8v+Veem2F/EzI7i3AnU3syXiC4Qv5XNw4OIQDfFUvR5jc3gwXfY KyRTAVrL98G+GtGQKsN18zm7Hfeyx0VD4z0hdlOGGR99QX6rjNVGr4uzlqPIH2zLHBxV FyEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=ZKv6CT3L; 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 m6-20020a056402430600b004534c7d4ebfsi417647edc.434.2022.09.29.12.57.13; Thu, 29 Sep 2022 12:57:38 -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=ZKv6CT3L; 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 S229986AbiI2TfG (ORCPT + 99 others); Thu, 29 Sep 2022 15:35:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbiI2Te5 (ORCPT ); Thu, 29 Sep 2022 15:34:57 -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 2A3FC2CCB5; Thu, 29 Sep 2022 12:34:55 -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=/P0dMVsN1isqnLkFGaEvl0LKDg5OiTgpL3SenF9SLsk=; b=ZKv6CT3Lwrga/vMAK0j7qCsgvC gfsxGntozXVXzyAB1+joZa2CkMKvguoxQfDHjQXXvgbcB1qKvCR9Jj1GFYo+Gn/vvW+8lcZ64A1p0 JfS1zRbi+oXFwSyBu/B2frwnhn/d6yUE19jimXr8rpi8Ww3iUsWX7LNC3aR9cB+KtcpSbFbrNc/yz jPLr4qHdlXiiI7tBInmXS/gXTnt2oaKpq524VwXVjLrZtlEAsc9Bzo3gEEw3IxajRlB0g3EXtjVWC o7UyaXHT+sfRLFqsbTT4QZRMPvstGPMfrYOCPyzo/I3xCOc/6mrSMF+3fWqjv2alM3dJvmiWTSy6f sbhAuQXA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1odzJ6-0054lU-0U; Thu, 29 Sep 2022 19:34:52 +0000 Date: Thu, 29 Sep 2022 20:34:52 +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 12:05:32PM -0700, Linus Torvalds wrote: > On Thu, Sep 29, 2022 at 12:00 PM Al Viro wrote: > > > > Which is insane, especially since the entire problem is due to wanting > > that directory to be different for different threads... > > Absolutely. This is all due to Apparmor (a) basing things on pathnames > and (b) then getting those pathnames wrong. > > Which is why I'm just suggesting we short-circuit the path-name part, > and not make this be a real symlink that actually walks a real path. > > The proc handling uses "readlink" to make it *look* like a > symlink, but then "get_link" to actually look it up (and never walk it > as a path). > > Something similar? Apparmor takes mount+dentry and turns that into pathname. Then acts upon the resulting string. *AFTER* the original had been resolved. IOW, it doesn't see the symlink contents - only the location where the entire thing ends up. AFAICS, the only way to make it STFU is either * fix the idiotic policy or * make the per-thread directory show up as /proc//net As in "../.. from there lands you in /proc". Because that's what apparmor does to generate the string it treats as the pathname...