Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp969137rwd; Thu, 1 Jun 2023 08:48:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5lzC5SX82NOy8sS3TdYp27OWMdjExt6PwTiKhDB02XUGWrv0T8uwR63gxgegYiIQvI3WHl X-Received: by 2002:a05:6a00:1903:b0:646:b165:1b29 with SMTP id y3-20020a056a00190300b00646b1651b29mr7968310pfi.23.1685634497368; Thu, 01 Jun 2023 08:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685634497; cv=none; d=google.com; s=arc-20160816; b=lSnweLr1VQnIdwUnDounYn1B/aSwhtVfo9wXZ+d6EFtsUVtHmGwuZFyeXeif0IaeEx QUtRZVvFjh2WSBDrznCeONB/VjALmV2DqxplYhuWoDKcMJKWSHtyqCWqC0ETnqX2JBY/ 7gr8S5l+txW1Mour9FkB1QyRYAYlu1zr3mTQkPRdd3j0CEGIWZ7nFQ6sahTGR2KjBCDv Qfa5kHmpx1YlvX+jxOJLrNW/lkfMaSPKzUcqNcFZNpKq36S07UIdYbnS68Pu1uqysBsG Iv4bT0KDvXGNCYLk0yrACkw2lnpV5lUFxabi4dR0/xYWa9lsIerl0/57LauwaPyXlT+c yWqw== 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=Pc3Omm6p9SlANvujtIchWarPa1exY+Pn4ZYe4fUiJ7Q=; b=IpAoKRuDJLyHyciG0IUfQagaMzi8mqHw7bde7qkRGPDXK52PzbYZW/2jbBNEJSbjKE 6qD/FTbGjo4PHDwV3MoguUqb2Y7QJYEnckcJL+RNf3phS+WuW7ebvmy58WJXfGVDLtUI 0NeUvQuCq018fDD43WZJWHBxULQmtjP5Uf9q5jdYhRC6cn2opyoRpiqQ0AtocMR5171a gi9DzYqZqmkRdlF1gdpvRYZKd080jncv+5eFWoqdsO6IlLrwhj9hosS8lGoVxGc/Bh2v vaauFOAv/j4qh4yzcOTAZxzqJGk09G0rVhfbuftVGvpbE9q5WyZ+c5fLpvqwPNsYvJ16 dc0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 m15-20020a633f0f000000b0053051c56825si2904510pga.777.2023.06.01.08.47.56; Thu, 01 Jun 2023 08:48:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 S234920AbjFAPhm convert rfc822-to-8bit (ORCPT + 99 others); Thu, 1 Jun 2023 11:37:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233663AbjFAPhl (ORCPT ); Thu, 1 Jun 2023 11:37:41 -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 A0AD4B3 for ; Thu, 1 Jun 2023 08:37:39 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-263-AHup6Xd1OrWFzyw2F6GqSw-1; Thu, 01 Jun 2023 16:37:36 +0100 X-MC-Unique: AHup6Xd1OrWFzyw2F6GqSw-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.48; Thu, 1 Jun 2023 16:37:32 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Thu, 1 Jun 2023 16:37:32 +0100 From: David Laight To: 'Jan Kara' , Christian Brauner CC: Al Viro , "linux-fsdevel@vger.kernel.org" , Miklos Szeredi , "Darrick J. Wong" , Ted Tso , Jaegeuk Kim , "linux-ext4@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-f2fs-devel@lists.sourceforge.net" , "stable@vger.kernel.org" Subject: RE: [PATCH v2 4/6] fs: Establish locking order for unrelated directories Thread-Topic: [PATCH v2 4/6] fs: Establish locking order for unrelated directories Thread-Index: AQHZlJ1FZufsO2GDRE+EhxV9kbhF9692EqgQ Date: Thu, 1 Jun 2023 15:37:32 +0000 Message-ID: References: <20230601104525.27897-1-jack@suse.cz> <20230601105830.13168-4-jack@suse.cz> <20230601-gebracht-gesehen-c779a56b3bf3@brauner> <20230601152449.h4ur5zrfqjqygujd@quack3> In-Reply-To: <20230601152449.h4ur5zrfqjqygujd@quack3> 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, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-ext4@vger.kernel.org ... > > > + * Lock any non-NULL argument. The caller must make sure that if he is passing > > > + * in two directories, one is not ancestor of the other Not directly relevant to this change but is the 'not an ancestor' check actually robust? I found a condition in which the kernel 'pwd' code (which follows the inode chain) failed to stop at the base of a chroot. I suspect that the ancestor check would fail the same way. IIRC the problematic code used unshare() to 'escape' from a network natespace. If it was inside a chroot (that wasn't on a mount point) there ware two copies of the 'chroot /' inode and the match failed. I might be able to find the test case. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)