Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp687757ybv; Thu, 13 Feb 2020 07:47:21 -0800 (PST) X-Google-Smtp-Source: APXvYqy2xN9/uFi/4mfqZLB76RGU4KvQCfm5Qy4Ak6O0rs+tWZnVvgpq1m1kooSsy1BjMIsMU/Ts X-Received: by 2002:a05:6830:1047:: with SMTP id b7mr14551077otp.77.1581608840939; Thu, 13 Feb 2020 07:47:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581608840; cv=none; d=google.com; s=arc-20160816; b=k8LJ/cQ9PGBZRIxkR9hYs9s7mFshayMnlQlzEHMBbj4ydOAKPVGYXWI6XlLi+8v9rW +sXkne74+BI6VKOsjpxQ3OBiceTRTTTAJZrx9pR+5oyFHa5maQKFkHGhpxM623t2zFXe HoCAaFxr2+FvgAgP18yHAOEkA4z/Ts40t00KMHrtErYwCTyQ2AsCtY4lfaKTdqiAX/gL D+4BIB6dUUyL4a89sadQym3my2TGHHO0dEHkTmRnSQ6sJrR5qFQbZpK3RoUHwaGVjKbx 5EYoFTPU/e4bW/hYD23dtppwt7Cu9gGHX4w8aHgogpXsFd7dCFRq+jMGZ67w3CJcJOsQ CETg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FjjfgVwY1A74SoxyPcEPJ1PqKt+W38kCWiugDY+CJHM=; b=CW6ypgFrCG3vULqttMOg2/5xmdiw6c9O6cWwDC7yVkIG2Yu0tanzLpi2YxoEsVoB1b +Dgx7a2CkLTRopBB5hfsW+zWFLuNCQvATWG6Y7M/+bnoRufF3lbKtnvip4CxYma1Ao5k aTJY30R1cVEKBrWhoC76o2+jZFsWPcFRRaQlWz0OjxOzaD44TaLyZEFxGMe/QJWFwSEd mpAqZyIUdCIz8zMQh/FTOQIVPNC4gIRcds+DWCcm8zGIjQulBWZ9OqrgXmktCP0uimpd C0VBsFXbA6HGGxZgnCXvokpgkuqH+mEmCzK8Ar91VEYp2j+4v11QA8DtVouIVKmAtnN2 SY9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ya4Yytys; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si1337507otd.141.2020.02.13.07.47.08; Thu, 13 Feb 2020 07:47:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ya4Yytys; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387927AbgBMPrG (ORCPT + 99 others); Thu, 13 Feb 2020 10:47:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:49252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728444AbgBMP1L (ORCPT ); Thu, 13 Feb 2020 10:27:11 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D3E5E206DB; Thu, 13 Feb 2020 15:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607631; bh=Om4DCQ6MWrdTNqEtW7PJVl/OK48/2nRUNwjKoGUwVKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ya4YytysVT9p1buR0L5VnFvluERK0PbhMKWfNfM4u/lnKGhRsmntEc3+siu7xL6uW JbA8DUQBiuXwLhpuzDAhRgz427KCIXcVriE39NqRgoCJMcUG7FKepJ4pzI/SiUrmqx 2jgyy+IWhJ1IbPo91u/8l7PeqfaYBQMf7TqHBrTE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Anna Schumaker Subject: [PATCH 5.4 31/96] NFSv4: pnfs_roc() must use cred_fscmp() to compare creds Date: Thu, 13 Feb 2020 07:20:38 -0800 Message-Id: <20200213151850.993479505@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151839.156309910@linuxfoundation.org> References: <20200213151839.156309910@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Trond Myklebust commit 387122478775be5d9816c34aa29de53d0b926835 upstream. When comparing two 'struct cred' for equality w.r.t. behaviour under filesystem access, we need to use cred_fscmp(). Fixes: a52458b48af1 ("NFS/NFSD/SUNRPC: replace generic creds with 'struct cred'.") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- fs/nfs/pnfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1425,7 +1425,7 @@ retry: /* lo ref dropped in pnfs_roc_release() */ layoutreturn = pnfs_prepare_layoutreturn(lo, &stateid, &iomode); /* If the creds don't match, we can't compound the layoutreturn */ - if (!layoutreturn || cred != lo->plh_lc_cred) + if (!layoutreturn || cred_fscmp(cred, lo->plh_lc_cred) != 0) goto out_noroc; roc = layoutreturn;