Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3695549imu; Mon, 28 Jan 2019 09:11:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN6HJAx315gm/4KYKDZfbl+ggQhy23U947D/Xecw3Rq2zrkZL7qavU21Yj6B4Evlk+XCpIBk X-Received: by 2002:a17:902:a6:: with SMTP id a35mr22600346pla.201.1548695495237; Mon, 28 Jan 2019 09:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695495; cv=none; d=google.com; s=arc-20160816; b=r4MubGlhQxdN6sKNPlcm1gOs9j+1YHdlQtaWN6jRFh9M+Us/VOgLfAc1QTGWKNq3G9 DGb8yWoGREEJjx6hxwn/E2Kg1byCSpISbLCy0eNxQYfkvXzgJF/kYJZj1cy4hkAvTCWt 0tOtwZpsZ8mZvzS8Wpzy/Jhg6JaTa46sbXrCtpd/XUMEL3CaxXWGPLsViuQEaEY+X2ws K4FH+C6x6BY7GlkHhwRPbrkE2GX5ymFKKPorFwBmaHNApYuWwnbD2PEtQrgA8ylBII4X Um7DNm//MuN8FRy6Nkzu0ek5dLbxlOhFsyCAtCrftFWi70iLgEez8O6rokY9hrbhHvu+ DhXQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nX6NTZpT21f72vgLvyA0CboQaIU4+eB32yisUKSzXuc=; b=OZ8oJvV73fIlAL5tTlnUEbvKl3ElVdRwkNIp31yseWrBtqV489Zhhvd9DeELuqAp2X C+OntFTewwN/7zhphSPZUmQqHulvZCRR2+JUJMegdvXMinFFNQHP1JUcShIomQBc6tpQ q1CQW7JzW6+dCLqfge8pJlRtVXuc4i0mw8BGpuMb6w/Wipisz3qlq+tYy47B/deuFMfk PcxCBD53y8pYU7OiPvWm1BrTMtRG8GAU/+3AGkAlYzuquI9zMVPHIVef31rgp73yfnGg TRR1+RW59Q26hd0aDnVQqZCu6RRXEmdpNaO1hS94/pU4HoPRYgMSXeXYqYWmLZRqLf8c pJcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u2i+SRxy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si32846121pfd.236.2019.01.28.09.11.19; Mon, 28 Jan 2019 09:11:35 -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=u2i+SRxy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732711AbfA1RLN (ORCPT + 99 others); Mon, 28 Jan 2019 12:11:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:35096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731968AbfA1QJv (ORCPT ); Mon, 28 Jan 2019 11:09:51 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B05C62171F; Mon, 28 Jan 2019 16:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691791; bh=fMY4GZNKsagDYDKlCbu25KvJ/aQt/jgMGzkEgozac28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u2i+SRxyn+jg5mUuoUDaoF02jqu5TxmR1XUH8PiYQQg0yQF8H4Pdwv4HGJ5rfh+R3 SbKHpOaVDWTBZM+vO0a+1nuAIoJtisKP0c8thRUQ7bCOm52pfZZwfuViXvOzsWqE2j 7iqmTQDH0QKYx5n3jJ1Das/uWwIXCT36Teiqvoog= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chris Perl , Anna Schumaker , Sasha Levin , linux-nfs@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 218/258] NFS: nfs_compare_mount_options always compare auth flavors. Date: Mon, 28 Jan 2019 10:58:44 -0500 Message-Id: <20190128155924.51521-218-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Perl [ Upstream commit 594d1644cd59447f4fceb592448d5cd09eb09b5e ] This patch removes the check from nfs_compare_mount_options to see if a `sec' option was passed for the current mount before comparing auth flavors and instead just always compares auth flavors. Consider the following scenario: You have a server with the address 192.168.1.1 and two exports /export/a and /export/b. The first export supports `sys' and `krb5' security, the second just `sys'. Assume you start with no mounts from the server. The following results in EIOs being returned as the kernel nfs client incorrectly thinks it can share the underlying `struct nfs_server's: $ mkdir /tmp/{a,b} $ sudo mount -t nfs -o vers=3,sec=krb5 192.168.1.1:/export/a /tmp/a $ sudo mount -t nfs -o vers=3 192.168.1.1:/export/b /tmp/b $ df >/dev/null df: ‘/tmp/b’: Input/output error Signed-off-by: Chris Perl Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- fs/nfs/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index ac4b2f005778..5ef2c71348bd 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2409,8 +2409,7 @@ static int nfs_compare_mount_options(const struct super_block *s, const struct n goto Ebusy; if (a->acdirmax != b->acdirmax) goto Ebusy; - if (b->auth_info.flavor_len > 0 && - clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor) + if (clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor) goto Ebusy; return 1; Ebusy: -- 2.19.1