Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp720996imw; Fri, 15 Jul 2022 11:34:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1st2euexRpG0k/GLcocJQzitF/7y5CYaPmsfnPKD6kWeS5bwTcIT87sDlWnRZCABnOCb1zJ X-Received: by 2002:a17:90a:7409:b0:1ef:8e95:c861 with SMTP id a9-20020a17090a740900b001ef8e95c861mr23964469pjg.115.1657910054477; Fri, 15 Jul 2022 11:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657910054; cv=none; d=google.com; s=arc-20160816; b=A9Z+sAA+SQwt5i0VpK9Aov96SlQbOny0swXnAmYSS04NX2oOlw1QtP0TCjhjutUZl7 Me4TPjoxKI4scft/0ypiGogUT3cETEhSkYI2zsyzXcwFE8pDMMquYONE9OpWR8O6xxwz wd1fWzF3bporJHDc3oBOgv5x+wYS0WNvpuDXFg/nuUgW7EtgVAJvs37GVD8k4VL4MTKq devc1u3uG7IsLQcx3wZXzQbK7ZlbAIZxvGMauCSkuKkXM29tsqq1Q+8HLmrLYhMwbMlO FR6/Ut296To4lmLVzrYEXPbluzSg3eilBY/Fs7aYS9KDur6N+q8rhqjYWGvZPv4pUqA/ RL3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xDUI+HZuCPS1xiLc8kDUnfuitxcYiTs/gVUmWSK0FxE=; b=mF8NwVMHFA9oNp3uOAAqlgA4dMF10XzNmL7ui5N2yANLN9C//MN1jJ0ptA0njfm00E nYGQvXld0yKLgnrIFtrn33QdBWBCECpRMKIn6/APXwK1c056PHhlY6qJmD8udQbrMMPk aQk3CPz9UixzQ5JG7PUYn6Rt9hGHhTNcAu0isws1gFfL8B7NtFsHC7lnzbiKkS7lYT88 jIOfksFIHsIPuTpJuh/BWrKERSTe0Zjp0J6wO/XfzA0TwcSaOYA8IMnmiEBqAnIreZFX 6XqM/LKX/lyF0uPJG6fS0NuL5/DR+U5uLGEeZOAaiSNMaSKCnCcdjlJehjJHD0grAHCj ZknA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a6CEWiX+; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 14-20020a63040e000000b0040c37758b54si5993298pge.114.2022.07.15.11.33.58; Fri, 15 Jul 2022 11:34:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@kernel.org header.s=k20201202 header.b=a6CEWiX+; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbiGOSdD (ORCPT + 99 others); Fri, 15 Jul 2022 14:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbiGOSdB (ORCPT ); Fri, 15 Jul 2022 14:33:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F408274E18 for ; Fri, 15 Jul 2022 11:33:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8EF4A62331 for ; Fri, 15 Jul 2022 18:33:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CB06C34115; Fri, 15 Jul 2022 18:32:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657909980; bh=lZauevyYMhrmczytBImVDmdnYpWSoIz7E6RtNSVRKlU=; h=From:To:Cc:Subject:Date:From; b=a6CEWiX+hiyaLXqFiRHVyBJLkv+ox0Y/DFXoPWmZpiQoTRoD9QUn0lOJq03k8EAxJ 6gFNj7cQMc1p8AQeMwQ+yb8U1Igu13ps5bofJdKwPy0dHuTTuLeVPxj6NfCBYmTmdw /rrAAqRqYKOeZPARZht2f/vMThUaJNojIZ9Z0GioojbbjbOF+u6WFcmsZg/mhvzqC3 JGR48P2qO8GI/sfAryoF6rE/q4MxNa0O5snG0zK4T1Sg5i+JFjXfnkd9NZgsTtG6VA 2577Yk1x5NX+FsgDHy1j9P29/efQrtIWzMAVC3pKX/SqlyEQ8aUp8nls5SLpmHe7qu DW6v0ysD7fiyA== From: Jeff Layton To: chuck.lever@oracle.com Cc: neilb@suse.de, linux-nfs@vger.kernel.org Subject: [PATCH v2 0/2] nfsd: close potential race between open and delegation Date: Fri, 15 Jul 2022 14:32:55 -0400 Message-Id: <20220715183257.41129-1-jlayton@kernel.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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-nfs@vger.kernel.org v2: - use nfsd_lookup_dentry instead of lookup_one_len Here's a respin of the patches to fix up the potential race between an open and delegation. I took Neil's advice an changed over to use nfsd_lookup_dentry. This patchset is based on top of Neil's recent patchset entitled: [PATCH 0/8] NFSD: clean up locking. Tested with xfstests and it seemed to behave. I haven't done any testing to ensure that the race is actually fixed, mainly because I don't have a way to reliably reproduce it. Jeff Layton (2): nfsd: drop fh argument from alloc_init_deleg nfsd: vet the opened dentry after setting a delegation fs/nfsd/nfs4state.c | 58 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 9 deletions(-) -- 2.36.1