]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/nfs-nfs_compare_mount_options-always-compare-auth-fl.patch
autosel patches for 4.14
[thirdparty/kernel/stable-queue.git] / queue-4.14 / nfs-nfs_compare_mount_options-always-compare-auth-fl.patch
1 From e2b79c06c8213e28db7f2caf028d82bf85ef8c4a Mon Sep 17 00:00:00 2001
2 From: Chris Perl <cperl@janestreet.com>
3 Date: Mon, 17 Dec 2018 10:56:38 -0500
4 Subject: NFS: nfs_compare_mount_options always compare auth flavors.
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 [ Upstream commit 594d1644cd59447f4fceb592448d5cd09eb09b5e ]
10
11 This patch removes the check from nfs_compare_mount_options to see if a
12 `sec' option was passed for the current mount before comparing auth
13 flavors and instead just always compares auth flavors.
14
15 Consider the following scenario:
16
17 You have a server with the address 192.168.1.1 and two exports /export/a
18 and /export/b. The first export supports `sys' and `krb5' security, the
19 second just `sys'.
20
21 Assume you start with no mounts from the server.
22
23 The following results in EIOs being returned as the kernel nfs client
24 incorrectly thinks it can share the underlying `struct nfs_server's:
25
26 $ mkdir /tmp/{a,b}
27 $ sudo mount -t nfs -o vers=3,sec=krb5 192.168.1.1:/export/a /tmp/a
28 $ sudo mount -t nfs -o vers=3 192.168.1.1:/export/b /tmp/b
29 $ df >/dev/null
30 df: ‘/tmp/b’: Input/output error
31
32 Signed-off-by: Chris Perl <cperl@janestreet.com>
33 Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
34 Signed-off-by: Sasha Levin <sashal@kernel.org>
35 ---
36 fs/nfs/super.c | 3 +--
37 1 file changed, 1 insertion(+), 2 deletions(-)
38
39 diff --git a/fs/nfs/super.c b/fs/nfs/super.c
40 index 38de09b08e96..3c4aeb83e1c4 100644
41 --- a/fs/nfs/super.c
42 +++ b/fs/nfs/super.c
43 @@ -2401,8 +2401,7 @@ static int nfs_compare_mount_options(const struct super_block *s, const struct n
44 goto Ebusy;
45 if (a->acdirmax != b->acdirmax)
46 goto Ebusy;
47 - if (b->auth_info.flavor_len > 0 &&
48 - clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor)
49 + if (clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor)
50 goto Ebusy;
51 return 1;
52 Ebusy:
53 --
54 2.19.1
55