All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Filz <ffilzlnx@mindspring.com>
To: linux-nfs@vger.kernel.org
Cc: trond.myklebust@primarydata.com, Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH] Use a separate superblock if mount requires a different security flavor
Date: Wed, 16 Sep 2015 11:49:27 -0700	[thread overview]
Message-ID: <1442429367.24127.6.camel@localhost.localdomain> (raw)

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




             reply	other threads:[~2015-09-16 18:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 18:49 Frank Filz [this message]
2015-09-16 20:52 ` [PATCH] Use a separate superblock if mount requires a different security flavor 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442429367.24127.6.camel@localhost.localdomain \
    --to=ffilzlnx@mindspring.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.