Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2622659rwb; Mon, 3 Oct 2022 03:41:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OZ+nFxNX1Tcm/yxgBwdfYJE6eV4Zl6yMzU9uiIrhVMM2ocfVqRp6mKI43vqOZ6Dg6sn6f X-Received: by 2002:a17:906:1e08:b0:73d:c724:4876 with SMTP id g8-20020a1709061e0800b0073dc7244876mr14297097ejj.62.1664793673503; Mon, 03 Oct 2022 03:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664793673; cv=none; d=google.com; s=arc-20160816; b=kOc2ktE8/XQsKF/o3E/qlfAfGV9LpH70NSE2tnsTCko0qnbBq5r97Ro0i3kKAS4TRM QW2VXRNqXYwnpTNxIc1k4e8ozlGpF1cljnrBQnIIThHvGHZAEe8ff6JG9wk3eM8IVF5l jsyYTZ718Heeey86fsd2LfZR03c6f5FcjeDZqnD4dr6UhLYPTESgl4SMu2r6kotBt7Yg J6g/2O1l81nrhFLBf7Uspv0PGn1BiqiRRUAwxyFaHx3hAk9DN0n89YQ9t+GLjk9+BRPN GgIKZQbSAdzc5v5JB3HVqxeYkuYeD3D6HeRePl8a3a131K4yjpLQLoufMb5EWjcKCQRV +v7g== 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:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=vA5GVfIYte3IhURpy6krqdpjlHfI3b3+wOhiBLFSy6w=; b=ejFnR84Krjh07VqluSO3IAXfDW/ui8/OEK37xOv4ZRUd24SQKGeB9Ct8EoMM1Odo6m BbVPUuNsJpsIq3QRcbKAZZf4tOh8ch0jQuxgW6vOakRH0zQqHoAux3tRxV5ah+5ZZhme 7mhPULBUZsehe9vVKn1u84qKBg0nSH9A65plY+syofFjzJoZ1mHMX4/0mECzWs96FTGL DEUJChX+6fseh6dbE9nh+bJdhgW5RhXubvBME1313HvmeSiWsghhmjOI6p7IFl8jkLUw Q73lGGL+MsbxIP3Pd5Vbo8hH2gk/f2r+Dxz/avTI+OQ60Ey9JHnx2K0ZFMtaltsEY0Xs nEuA== 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 re7-20020a170906d8c700b0077076dec2cdsi6724034ejb.907.2022.10.03.03.40.46; Mon, 03 Oct 2022 03:41:13 -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 S230138AbiJCJnF convert rfc822-to-8bit (ORCPT + 99 others); Mon, 3 Oct 2022 05:43:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbiJCJmp (ORCPT ); Mon, 3 Oct 2022 05:42:45 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22DCA5E67D for ; Mon, 3 Oct 2022 02:37:18 -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-164-EXXU3AVOMbmkJ1Ef--quHg-1; Mon, 03 Oct 2022 10:36:53 +0100 X-MC-Unique: EXXU3AVOMbmkJ1Ef--quHg-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Mon, 3 Oct 2022 10:36:46 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.040; Mon, 3 Oct 2022 10:36:46 +0100 From: David Laight To: 'Al Viro' CC: "'Eric W. Biederman'" , Linus Torvalds , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "Serge E. Hallyn" Subject: RE: [CFT][PATCH] proc: Update /proc/net to point at the accessing threads network namespace Thread-Topic: [CFT][PATCH] proc: Update /proc/net to point at the accessing threads network namespace Thread-Index: AQHY1Ogi381Lc0KOOEGaF1/0a4qSLq34eHYAgAGjVQCAAk+PUA== Date: Mon, 3 Oct 2022 09:36:46 +0000 Message-ID: <592405fa149247f58d05a213b8c6f711@AcuMS.aculab.com> References: <871qrt4ymg.fsf@email.froward.int.ebiederm.org> <87ill53igy.fsf_-_@email.froward.int.ebiederm.org> <87a66g25wm.fsf@email.froward.int.ebiederm.org> <9bf5e96b383e4a979618cb0f729cb833@AcuMS.aculab.com> In-Reply-To: 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: 0 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 ... > * ability to chroot(2) had always been equivalent to ability to undo > chroot(2). If you want to prevent getting out of there, you need > (among other things) to prevent the processes to be confined from > further chroot(2). Not always, certainly not historically. chroot() inside a chroot() just constrained you further. If fchdir() and openat() have broken that it is a serious problem. NetBSD certainly has checks to detect (log and fix) programs that have (or might) escape from chroots. unshare() seems to create a 'shadow' inode structure for the chroot's "/" so at least some of the tests when following ".." fail to detect it. I also thought containers relied on the same scheme? (But I'm too old fashioned to have looked into them!) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)