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 1B70FC433F5 for ; Thu, 29 Sep 2022 19:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbiI2TfG (ORCPT ); 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 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...