Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2674126imj; Mon, 11 Feb 2019 06:51:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IaJi2mCoDuXcB3H8ZcnIl8MtAMnzAYkaWZh/MO1zivzlnYiFBQmh9ss1ITB+I3uVZERiQPv X-Received: by 2002:a63:ff60:: with SMTP id s32mr32881263pgk.266.1549896670734; Mon, 11 Feb 2019 06:51:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549896670; cv=none; d=google.com; s=arc-20160816; b=u55g959TmyGA3gr6ODOMjn0Gw3F38Jcjpyv0w282ADnLO7ZJrPrGoa9Ah0o3KnFKDr BV5tRcnzFzSQQCGyCwMEsscctaDEkHwaiK6KH4mUWYmsknfWTOk4tqJNytydiRsDKT7T nkLuLRtplEn0w7/y5JwOGvvAxoEoVLeH8DTrw21qkkJYQcfS/eTXqZiNnm6j2k092ebG /SBzu+piA3Opwm7XY4D+paSd+Y9samjzppP+8V2QzGaBxJTFZxM9AMH3+oa7heW3M71p mhsP9IKfZADtLVSxJWwBdmoau3lSwv549/997B8HwoCWmSTCJW1ShHjypEWxZsKKamYB 3crw== 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=fgfThPwfSFtsKn6SXLMx1jChME/NX9Gk1VIf//4lvMI=; b=qlYFgU2ePojNyYw+U1ZD41r950oVJlE/Zbd4y9sVXQxGF81NdTCAW4sSFwfpo9NT8d JelZCF83pOT2NRNa237AQg82xYVSDVKQ6QlpAtmC+k/wWmsO2sKveOJNjEqOG+iP8TcV yAEL/sKfcPiA4Bucl4LOfvkCEn9p7eE1ZTFu4XIqQzuiBofSYCBxHiFIQHXqqI3Uvp+1 uo/ErPpzdyzc2m523ikYbS56eGkmQ9jdOVLUQlivpG7lJFmYDrpT61IXjElx0jlx1AMi gp7bVhEJh4r/Mp5okeP20i6Ija/U9CDs75C1NbmgQfEqwwcBqoDAoHCLyVH7uM6iDid/ hJUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eIopuWv3; 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 n7si10168934plk.18.2019.02.11.06.50.54; Mon, 11 Feb 2019 06:51:10 -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=eIopuWv3; 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 S1733248AbfBKOsi (ORCPT + 99 others); Mon, 11 Feb 2019 09:48:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:33900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387709AbfBKOsg (ORCPT ); Mon, 11 Feb 2019 09:48:36 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 DF611206BA; Mon, 11 Feb 2019 14:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896515; bh=0km0BCjU/c2mtviA5U3wLTfqdGPxuyXvr0Mtbt57Hhw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eIopuWv3w1O2Jll4ziuLbYYfxxZma6BHpexs/1CInWPrkkED3kIsBJK3MCOZBZ/3b WEvJnDIVlsJBdAGiAGe7xz9Vu0DNfy74BzwDi5hORyEgD98pgz5F9z7SuCERexI3Se dO6qic3fJKfb91E+CvKnZd2Xs8ntrm820CWLOPXU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Perl , Anna Schumaker , Sasha Levin Subject: [PATCH 4.19 209/313] NFS: nfs_compare_mount_options always compare auth flavors. Date: Mon, 11 Feb 2019 15:18:09 +0100 Message-Id: <20190211141907.112074618@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141852.749630980@linuxfoundation.org> References: <20190211141852.749630980@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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