Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2019-06-11 12:19:24 +1000
committerNeilBrown <neilb@suse.com>2019-06-11 12:19:24 +1000
commit3752b397148b82ae2eddd76d4604c74377b388e2 (patch)
treec865a6fc16c71231b730dce9b5cad413dbac7335
parent4b7d69cb1867763bedde4a736b950d135637cec8 (diff)
NFS add module option to limit NFSv4 minor version (jsc#PM-231).
-rw-r--r--patches.suse/NFS-optional-NFSv4_2.patch51
-rw-r--r--series.conf1
2 files changed, 52 insertions, 0 deletions
diff --git a/patches.suse/NFS-optional-NFSv4_2.patch b/patches.suse/NFS-optional-NFSv4_2.patch
new file mode 100644
index 0000000000..239747c014
--- /dev/null
+++ b/patches.suse/NFS-optional-NFSv4_2.patch
@@ -0,0 +1,51 @@
+From: NeilBrown <neilb@suse.com>
+Subject: NFS add module option to limit NFSv4 minor version.
+Patch-mainline: Never, suse-specific
+References: jsc#PM-231
+
+We want to provide NFSv4.2 client support as opt-in.
+Default mount.nfs behaviour is to mount highest version supported.
+So add a module option to set highest supported option, and
+reject mount attempt for higher minor.
+Set default to '1' for SLE12 and SLE15.0
+Set default to '2' for SLE15-SP1 and later.
+
+Signed-off-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/super.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/fs/nfs/super.c
++++ b/fs/nfs/super.c
+@@ -76,6 +76,12 @@
+ #define NFS_DEFAULT_VERSION 2
+ #endif
+
++#if CONFIG_SUSE_VERSION < 15 || (CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 0)
++static int max_minor_version = 1;
++#else
++static int max_minor_version = 2;
++#endif
++
+ #define NFS_MAX_CONNECTIONS 16
+
+ enum {
+@@ -1425,6 +1431,8 @@ static int nfs_parse_mount_options(char
+ goto out_invalid_value;
+ if (option > NFS4_MAX_MINOR_VERSION)
+ goto out_invalid_value;
++ if (option > max_minor_version)
++ goto out_invalid_value;
+ mnt->minorversion = option;
+ break;
+
+@@ -2923,5 +2931,8 @@ MODULE_PARM_DESC(recover_lost_locks,
+ "If the server reports that a lock might be lost, "
+ "try to recover it risking data corruption.");
+
++module_param(max_minor_version, int, 0644);
++MODULE_PARM_DESC(max_minor_version,
++ "Maximum NFSv4.x minor version that can be mounted");
+
+ #endif /* CONFIG_NFS_V4 */
diff --git a/series.conf b/series.conf
index ea294b075d..fd09449f9d 100644
--- a/series.conf
+++ b/series.conf
@@ -22630,6 +22630,7 @@
patches.kabi/sunrpc-use-after-free-in-svc_process_common.patch
patches.fixes/sunrpc-cache-handle-missing-listeners-better.patch
+ patches.suse/NFS-optional-NFSv4_2.patch
########################################################
# Overlayfs