Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2317040rwb; Thu, 29 Sep 2022 08:44:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7uraJGMdGTLPRab9D65Pzc/K0pntj5GQJZOJhX9blhX+yYPcWO/Oxohi27+hU9UYIM/Ip2 X-Received: by 2002:a05:6a00:194f:b0:54d:d12e:93aa with SMTP id s15-20020a056a00194f00b0054dd12e93aamr3882201pfk.34.1664466269529; Thu, 29 Sep 2022 08:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664466269; cv=none; d=google.com; s=arc-20160816; b=Npwmxd8aXzc7jnHiH6tr7ELIuP3fhSVCAytmWpbeFTmoyAd2iP9Gh6hE9UbTogG3cV 81W/ZXzSqrCl/oT2hwT8wamggn3Paj7bcqiq+0AWI0p45jfGUT8hv83TIV8/thfQms0P uxYngMrtNmLviuSoLKJLqiHiqXa1Lnkhp9UwoTPx5+3ZB63GVi9UOGRT6982NN6sviTR tCWDTWuBeMYcM92yKUlM1cDaLnEhSrX2EH3BjRHkkoguUbirAh0Duag+gsq2XsWbS8jv CYDEhiLjzJUht4fqEmJgNMdJnd8i6g8i1cEw6z/c5bgiLvd4vF2sC/IifKcFx55T1eSq NUSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=H12lU/1oBTk/7dTj1QNULgASH1MV9qxmSt8dFih9o1k=; b=Dn1P7I2aCZOQJFmvQQ88y0PONyexliESSpF81nqqi4mw/6d65WB6LHVK6x1fBKHMWg shuGr1VBJsT4U5B7hr0Oai0/18EgZXyfdR7106lMbWOJBZalH5mWhCAAiOpHPD481LsM a6UuH0HTMtsrJMxl74xXBBhr2OC4DuMzGwoEt09UfgeL8J7Desu8aRluKvOmkkrhR8W1 2bxFM78KSJ3FO1PAQ7CGrpElS+wY2MRr8kQACKh2Vjz/tqHhvkviMrUagu+6+iZSrl01 r4h4xR8l4q5il2PMPaItY49Xof4zwgVgrcmu2juwf//qbvJz9KyAJ4m050co/4RA0m8Q zPEQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a6566d4000000b0043a93922655si71493pgw.334.2022.09.29.08.44.09; Thu, 29 Sep 2022 08:44:29 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235898AbiI2PW2 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 29 Sep 2022 11:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235897AbiI2PW0 (ORCPT ); Thu, 29 Sep 2022 11:22:26 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 678341514D5 for ; Thu, 29 Sep 2022 08:22:16 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-215-KJpOk1o4M2ult_yIQyhK4w-1; Thu, 29 Sep 2022 16:22:11 +0100 X-MC-Unique: KJpOk1o4M2ult_yIQyhK4w-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Thu, 29 Sep 2022 16:22:10 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.040; Thu, 29 Sep 2022 16:22:10 +0100 From: David Laight To: "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" CC: "Eric W. Biederman" , "Serge E. Hallyn" , Linus Torvalds Subject: re: [PATCH 3/4] proc: Point /proc/net at /proc/thread-self/net instead of /proc/self/net Thread-Topic: re: [PATCH 3/4] proc: Point /proc/net at /proc/thread-self/net instead of /proc/self/net Thread-Index: AdjUFaAzwFjoFpF4RWSGA65kFT23EA== Date: Thu, 29 Sep 2022 15:22:10 +0000 Message-ID: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 1 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 I've just bumped into (the lack of) this change (from aug 2014): > In oddball cases where the thread has a different network namespace > than the primary thread group leader or more likely in cases where > the thread remains and the thread group leader has exited this > ensures that /proc/net continues to work. > - proc_symlink("net", NULL, "self/net"); > + proc_symlink("net", NULL, "thread-self/net"); This was applied and then reverted by Linus (I can't find anything in the LKML archive) - see git show 155134fef - because of issues with apparmor and dhclient. In my case we have an application that is started in one network namespace (where most of what it needs to do exists) but needs one thread to revert to the 'init' namespace in order to accept TCP connections from applications. The thread that reverts is the main thread. Until a change made in the last 6 months it actually worked. (I'm using 5.10 LTS kernels so I'm not sure when.) Then a fix was made to correctly update the mounts when the namespace changed - and it suddenly stopped working. So the 'oddball' case of different threads being in different namespaces and then accessing /proc/net (because that is what the code always did before being changed to run in a namespace) has happened to a real application. Fortunately it happened in testing and the application could be changed. (I was looking at the kernel sources to propose the change that got reverted!) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)