All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Use a separate superblock if mount requires a different security flavor
@ 2015-09-16 18:49 Frank Filz
  2015-09-16 20:52 ` Trond Myklebust
  0 siblings, 1 reply; 14+ messages in thread
From: Frank Filz @ 2015-09-16 18:49 UTC (permalink / raw)
  To: linux-nfs; +Cc: trond.myklebust, Chuck Lever

If a server has two exports from the same filesystem but with different
security flavors allowed, when the client mounts first one and then the
second, the same super block was being used. This resulted in the
security flavor for the first export being applied to access to the
second export.

The fix is simply to check the security flavor of the nfs_server
temporarily constructed for the second mount within nfs_compare_super.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
---
 fs/nfs/super.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 084af10..44d60f1 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2455,6 +2455,9 @@ static int nfs_compare_super(struct super_block
*sb, void *data)
        struct nfs_server *server = sb_mntdata->server, *old =
NFS_SB(sb);
        int mntflags = sb_mntdata->mntflags;
 
+       if(old->client->cl_auth->au_flavor
+          != server->client->cl_auth->au_flavor)
+               return 0;
        if (!nfs_compare_super_address(old, server))
                return 0;
        /* Note: NFS_MOUNT_UNSHARED == NFS4_MOUNT_UNSHARED */
-- 
1.9.3




^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-09-22 18:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 18:49 [PATCH] Use a separate superblock if mount requires a different security flavor Frank Filz
2015-09-16 20:52 ` Trond Myklebust
2015-09-16 20:55   ` Chuck Lever
2015-09-16 21:20     ` Trond Myklebust
2015-09-16 21:36       ` Frank Filz
2015-09-17  3:32         ` Trond Myklebust
2015-09-17 18:01           ` Chuck Lever
2015-09-21 23:10             ` Chuck Lever
2015-09-22  0:43               ` Trond Myklebust
2015-09-22  1:31                 ` Chuck Lever
2015-09-22  5:24                   ` Tom Haynes
2015-09-22 13:00                   ` Trond Myklebust
2015-09-22 18:17                     ` Frank Filz
2015-09-22  3:03                 ` Frank Filz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.