aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorScott Mayhew <smayhew@redhat.com>2014-08-04 17:37:27 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-08-04 17:41:52 -0400
commit71a6ec8ac587418ceb6b420def1ca44b334c1ff7 (patch)
treeebe9b151f8d64a9f6c7ce9b69a1eef52821da287 /fs
parent5b53dc88b064cb93274e7fb81f8df477287c80df (diff)
nfs: reject changes to resvport and sharecache during remount
Commit c8e47028 made it possible to change resvport/noresvport and sharecache/nosharecache via a remount operation, neither of which should be allowed. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Fixes: c8e47028 (nfs: Apply NFS_MOUNT_CMP_FLAGMASK to nfs_compare_remount_data) Cc: stable@vger.kernel.org # 3.16+ Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/super.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index c08e837c29e5..e4499d5b51e8 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2179,7 +2179,7 @@ out_no_address:
2179 return -EINVAL; 2179 return -EINVAL;
2180} 2180}
2181 2181
2182#define NFS_MOUNT_CMP_FLAGMASK ~(NFS_MOUNT_INTR \ 2182#define NFS_REMOUNT_CMP_FLAGMASK ~(NFS_MOUNT_INTR \
2183 | NFS_MOUNT_SECURE \ 2183 | NFS_MOUNT_SECURE \
2184 | NFS_MOUNT_TCP \ 2184 | NFS_MOUNT_TCP \
2185 | NFS_MOUNT_VER3 \ 2185 | NFS_MOUNT_VER3 \
@@ -2187,15 +2187,16 @@ out_no_address:
2187 | NFS_MOUNT_NONLM \ 2187 | NFS_MOUNT_NONLM \
2188 | NFS_MOUNT_BROKEN_SUID \ 2188 | NFS_MOUNT_BROKEN_SUID \
2189 | NFS_MOUNT_STRICTLOCK \ 2189 | NFS_MOUNT_STRICTLOCK \
2190 | NFS_MOUNT_UNSHARED \
2191 | NFS_MOUNT_NORESVPORT \
2192 | NFS_MOUNT_LEGACY_INTERFACE) 2190 | NFS_MOUNT_LEGACY_INTERFACE)
2193 2191
2192#define NFS_MOUNT_CMP_FLAGMASK (NFS_REMOUNT_CMP_FLAGMASK & \
2193 ~(NFS_MOUNT_UNSHARED | NFS_MOUNT_NORESVPORT))
2194
2194static int 2195static int
2195nfs_compare_remount_data(struct nfs_server *nfss, 2196nfs_compare_remount_data(struct nfs_server *nfss,
2196 struct nfs_parsed_mount_data *data) 2197 struct nfs_parsed_mount_data *data)
2197{ 2198{
2198 if ((data->flags ^ nfss->flags) & NFS_MOUNT_CMP_FLAGMASK || 2199 if ((data->flags ^ nfss->flags) & NFS_REMOUNT_CMP_FLAGMASK ||
2199 data->rsize != nfss->rsize || 2200 data->rsize != nfss->rsize ||
2200 data->wsize != nfss->wsize || 2201 data->wsize != nfss->wsize ||
2201 data->version != nfss->nfs_client->rpc_ops->version || 2202 data->version != nfss->nfs_client->rpc_ops->version ||