From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E434FC3E8A4 for ; Mon, 28 Jan 2019 16:35:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF7DB20811 for ; Mon, 28 Jan 2019 16:35:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548693321; bh=g6zLky/02Slrue3L9lmQ9eYw1JR/As+2YgEmSo3Lnmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=O39Mp37bxr12eZkUDSIiq/hMvCuxvts5GiN7ZyPT7Um4ZEwCRqc4Wqi/VgH++Wkcg km9DdG2Z59CDAybWuLkeeMfMUUie3CwUUflRVogNTezLIDiMoTSDxV9x6oDfni2hcs ZnA6JxTah/H2oXdUEbZhwrVRhhIMbYNm0oJAxUIU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388520AbfA1QfQ (ORCPT ); Mon, 28 Jan 2019 11:35:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:34838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390047AbfA1QZu (ORCPT ); Mon, 28 Jan 2019 11:25:50 -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 BCE5D2175B; Mon, 28 Jan 2019 16:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548692749; bh=g6zLky/02Slrue3L9lmQ9eYw1JR/As+2YgEmSo3Lnmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i3gqqPxWZHYJ0Ni8trbYTLeh8lqYE9EqjlslA98Q8mGjrxnQrV+ACCqAxHr6oW17G LJYbpwM8oZDEGKM+zlM9glacAqGFiRo+9UDv9m2PMFfJZEQbyfU2x2agX8lc5PhUwt 8qKzJ9oTwvgqCuD+DXFSKgj+vJTkMDCKu43njpiI= 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.4 62/80] NFS: nfs_compare_mount_options always compare auth flavors. Date: Mon, 28 Jan 2019 11:23:43 -0500 Message-Id: <20190128162401.58841-62-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128162401.58841-1-sashal@kernel.org> References: <20190128162401.58841-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-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@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 62f358f67764..412fcfbc50e2 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2376,8 +2376,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