Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3819407rwb; Tue, 8 Nov 2022 08:42:57 -0800 (PST) X-Google-Smtp-Source: AMsMyM5PuUgYxGdePdhO/roSMTBqvlYb7GGiQxmqFt1BnMzC9UoFNSciVUIsTeE9AIJUEldtNlnS X-Received: by 2002:a17:907:75e4:b0:7ae:2336:9d17 with SMTP id jz4-20020a17090775e400b007ae23369d17mr26910943ejc.7.1667925777665; Tue, 08 Nov 2022 08:42:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667925777; cv=none; d=google.com; s=arc-20160816; b=htQ1AykaJhkiMD7keIV+i4Gcs1nRQE9bXAB/7XG1O1Muc5+ZTe/B+kW88o+8XZuwet qL6Cz7MgLWinh0zkigv8ohZZel5szLjngrG6QVrGPBEA62ofb/O4KxWJPjoSF70Vi6hN 8RCSgCf+8WGPe6qFMauj5Ve31kk3wD6LfCEL2s3k4uTCfG/cHzjuhQeLzGnEJr0rTEc4 WwuYXEya+U6xAmiGcEPe2kF47ZVzfFOjtu3HPgz2qmqp53vroUbY0Ul78cT8vRTs67J1 xkMFtxrYVskMwcpZul5ooPH1I+ZYkeli2rpKzYi6SCGi94l/aVPyz4nBesSgNe5vbQM1 Nt9Q== 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=z4Sw3ALnQHpjKyaKBurq7IkiK+0tLaTku1XOMMT8Xrw=; b=y5xIuS5U6JbAk2FJ1hAC9DEVxQqNMe+kLvr0rpMs/10uGOMaXKy/8G5bM2drKCaeKE o8lScHLGirUwIlU1HXkOlmI0Cg79vDF6ZRn5oFBtoIGbA6+elFr7JRC1BYoSh7IdZJDM E/+YA5saXAS3W/kUKizlLUfFk9AF/RNVVpbxLnZ8RMWD/WZleEFcbGbMTr6INw0EcP6j ibm6gOOBmFYldG34gJ+JrnXa0RNNcWhCpxbTsmyo1bYWvFpTQdNs26Inw8OKf5nnOhpN xIZGI02PqmmX+Q+ioFX6ZWwIchxt59apo//Bdsj1l7U1ooFApv2lC3yybKAmQFThJ/z4 O2PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cYE5s1yU; 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 nd10-20020a170907628a00b007ae199ea55asi14104606ejc.817.2022.11.08.08.42.31; Tue, 08 Nov 2022 08:42:57 -0800 (PST) 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=cYE5s1yU; 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 S234604AbiKHQXS (ORCPT + 99 others); Tue, 8 Nov 2022 11:23:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232035AbiKHQXR (ORCPT ); Tue, 8 Nov 2022 11:23:17 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96F15A1AE for ; Tue, 8 Nov 2022 08:23:16 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id CBB7AB81BA7 for ; Tue, 8 Nov 2022 16:23:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 156CBC433C1; Tue, 8 Nov 2022 16:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667924593; bh=nz5VGkOq8B2GHyY4UZcHdVJ2ElHwQ71fq2QNhGZrjpE=; h=From:To:Cc:Subject:Date:From; b=cYE5s1yUXJFERYophrNfsSTMpCJm+TPoarNmqwzAEPznyyxESc2+L8hPqQgcs6ScD ZQ2Wf8EvTu6jvL/ybGdvA9Xgk4GmktfWHcayMeeLpwB9Bju9iIbDXk6OoW16zodt3m lSgQsiPBMiiGGxeoXM8KB6e6VTGbKvzFXetXZpIAzeKFMLnHpkZMxKf+M3t6/RNeV4 I6oUD5issLrO7LSGXH/SixQ13c6XK6/sKEJGfhJ9Pv4XXOCyKiPlUVXLuexRi9r1g/ ikx83ThJ5dNLytmioy8FLRFJ8k/COdxfOHYcI3YeulOGnW2j/SydyUwaUPLwi55CU1 F38tjeT1mLZsw== From: Jeff Layton To: chuck.lever@oracle.com Cc: linux-nfs@vger.kernel.org, Yongcheng Yang Subject: [PATCH] nfsd: put the export reference in nfsd4_verify_deleg_dentry Date: Tue, 8 Nov 2022 11:23:11 -0500 Message-Id: <20221108162311.320755-1-jlayton@kernel.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 nfsd_lookup_dentry returns an export reference in addition to the dentry ref. Ensure that we put it too. Link: https://bugzilla.redhat.com/show_bug.cgi?id=2138866 Fixes: 876c553cb410 ("NFSD: verify the opened dentry after setting a delegation") Reported-by: Yongcheng Yang Signed-off-by: Jeff Layton --- fs/nfsd/nfs4state.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 554c4e50caf8..2ec981fd2985 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5407,6 +5407,7 @@ nfsd4_verify_deleg_dentry(struct nfsd4_open *open, struct nfs4_file *fp, if (err) return -EAGAIN; + exp_put(exp); dput(child); if (child != file_dentry(fp->fi_deleg_file->nf_file)) return -EAGAIN; -- 2.38.1