Patch "nfsd: allow disabling NFSv2 at compile time" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nfsd: allow disabling NFSv2 at compile time

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nfsd-allow-disabling-nfsv2-at-compile-time.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From ca0bebbcc3bee825aa4f8768aca93a41aa076bbb Mon Sep 17 00:00:00 2001
From: Jeff Layton <jlayton@xxxxxxxxxx>
Date: Tue, 18 Oct 2022 07:47:56 -0400
Subject: nfsd: allow disabling NFSv2 at compile time

From: Jeff Layton <jlayton@xxxxxxxxxx>

[ Upstream commit 2f3a4b2ac2f28b9be78ad21f401f31e263845214 ]

rpc.nfsd stopped supporting NFSv2 a year ago. Take the next logical
step toward deprecating it and allow NFSv2 support to be compiled out.

Add a new CONFIG_NFSD_V2 option that can be turned off and rework the
CONFIG_NFSD_V?_ACL option dependencies. Add a description that
discourages enabling it.

Also, change the description of CONFIG_NFSD to state that the always-on
version is now 3 instead of 2.

Finally, add an #ifdef around "case 2:" in __write_versions. When NFSv2
is disabled at compile time, this should make the kernel ignore attempts
to disable it at runtime, but still error out when trying to enable it.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
Reviewed-by: Tom Talpey <tom@xxxxxxxxxx>
Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/nfsd/Kconfig  |   19 +++++++++++++++----
 fs/nfsd/Makefile |    5 +++--
 fs/nfsd/nfsctl.c |    2 ++
 fs/nfsd/nfsd.h   |    3 +--
 fs/nfsd/nfssvc.c |    6 ++++++
 5 files changed, 27 insertions(+), 8 deletions(-)

--- a/fs/nfsd/Kconfig
+++ b/fs/nfsd/Kconfig
@@ -8,6 +8,7 @@ config NFSD
 	select SUNRPC
 	select EXPORTFS
 	select NFS_ACL_SUPPORT if NFSD_V2_ACL
+	select NFS_ACL_SUPPORT if NFSD_V3_ACL
 	depends on MULTIUSER
 	help
 	  Choose Y here if you want to allow other computers to access
@@ -26,19 +27,29 @@ config NFSD
 
 	  Below you can choose which versions of the NFS protocol are
 	  available to clients mounting the NFS server on this system.
-	  Support for NFS version 2 (RFC 1094) is always available when
+	  Support for NFS version 3 (RFC 1813) is always available when
 	  CONFIG_NFSD is selected.
 
 	  If unsure, say N.
 
-config NFSD_V2_ACL
-	bool
+config NFSD_V2
+	bool "NFS server support for NFS version 2 (DEPRECATED)"
 	depends on NFSD
+	default n
+	help
+	  NFSv2 (RFC 1094) was the first publicly-released version of NFS.
+	  Unless you are hosting ancient (1990's era) NFS clients, you don't
+	  need this.
+
+	  If unsure, say N.
+
+config NFSD_V2_ACL
+	bool "NFS server support for the NFSv2 ACL protocol extension"
+	depends on NFSD_V2
 
 config NFSD_V3_ACL
 	bool "NFS server support for the NFSv3 ACL protocol extension"
 	depends on NFSD
-	select NFSD_V2_ACL
 	help
 	  Solaris NFS servers support an auxiliary NFSv3 ACL protocol that
 	  never became an official part of the NFS version 3 protocol.
--- a/fs/nfsd/Makefile
+++ b/fs/nfsd/Makefile
@@ -10,9 +10,10 @@ obj-$(CONFIG_NFSD)	+= nfsd.o
 # this one should be compiled first, as the tracing macros can easily blow up
 nfsd-y			+= trace.o
 
-nfsd-y 			+= nfssvc.o nfsctl.o nfsproc.o nfsfh.o vfs.o \
-			   export.o auth.o lockd.o nfscache.o nfsxdr.o \
+nfsd-y 			+= nfssvc.o nfsctl.o nfsfh.o vfs.o \
+			   export.o auth.o lockd.o nfscache.o \
 			   stats.o filecache.o nfs3proc.o nfs3xdr.o
+nfsd-$(CONFIG_NFSD_V2) += nfsproc.o nfsxdr.o
 nfsd-$(CONFIG_NFSD_V2_ACL) += nfs2acl.o
 nfsd-$(CONFIG_NFSD_V3_ACL) += nfs3acl.o
 nfsd-$(CONFIG_NFSD_V4)	+= nfs4proc.o nfs4xdr.o nfs4state.o nfs4idmap.o \
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -581,7 +581,9 @@ static ssize_t __write_versions(struct f
 
 			cmd = sign == '-' ? NFSD_CLEAR : NFSD_SET;
 			switch(num) {
+#ifdef CONFIG_NFSD_V2
 			case 2:
+#endif
 			case 3:
 				nfsd_vers(nn, num, cmd);
 				break;
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -64,8 +64,7 @@ struct readdir_cd {
 
 
 extern struct svc_program	nfsd_program;
-extern const struct svc_version	nfsd_version2, nfsd_version3,
-				nfsd_version4;
+extern const struct svc_version	nfsd_version2, nfsd_version3, nfsd_version4;
 extern struct mutex		nfsd_mutex;
 extern spinlock_t		nfsd_drc_lock;
 extern unsigned long		nfsd_drc_max_mem;
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -91,8 +91,12 @@ unsigned long	nfsd_drc_mem_used;
 #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
 static struct svc_stat	nfsd_acl_svcstats;
 static const struct svc_version *nfsd_acl_version[] = {
+# if defined(CONFIG_NFSD_V2_ACL)
 	[2] = &nfsd_acl_version2,
+# endif
+# if defined(CONFIG_NFSD_V3_ACL)
 	[3] = &nfsd_acl_version3,
+# endif
 };
 
 #define NFSD_ACL_MINVERS            2
@@ -116,7 +120,9 @@ static struct svc_stat	nfsd_acl_svcstats
 #endif /* defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) */
 
 static const struct svc_version *nfsd_version[] = {
+#if defined(CONFIG_NFSD_V2)
 	[2] = &nfsd_version2,
+#endif
 	[3] = &nfsd_version3,
 #if defined(CONFIG_NFSD_V4)
 	[4] = &nfsd_version4,


Patches currently in stable-queue which might be from jlayton@xxxxxxxxxx are

queue-6.1/nfsd-refactor-find_file.patch
queue-6.1/lockd-use-locks_inode_context-helper.patch
queue-6.1/nfsd-remove-redundant-assignment-to-variable-host_err.patch
queue-6.1/nfsd-ignore-requests-to-disable-unsupported-versions.patch
queue-6.1/nfsd-fix-licensing-header-in-filecache.c.patch
queue-6.1/nfsd-trace-stateids-returned-via-delegreturn.patch
queue-6.1/lockd-ensure-we-use-the-correct-file-descriptor-when-unlocking.patch
queue-6.1/nfsd-update-file_hashtbl-helpers.patch
queue-6.1/nfsd-clean-up-nfs4_preprocess_stateid_op-call-sites.patch
queue-6.1/nfsd-don-t-destroy-global-nfs4_file-table-in-per-net-shutdown.patch
queue-6.1/nfsd-use-only-rq_dropme-to-signal-the-need-to-drop-a-reply.patch
queue-6.1/nfsd-use-locks_inode_context-helper.patch
queue-6.1/nfsd-use-struct_size-helper-in-alloc_session.patch
queue-6.1/nfsd-fix-up-the-filecache-laundrette-scheduling.patch
queue-6.1/nfsd-move-nfserrno-to-vfs.c.patch
queue-6.1/nfsd-use-const-pointers-as-parameters-to-fh_-helpers.patch
queue-6.1/nfsd-use-rhashtable-for-managing-nfs4_file-objects.patch
queue-6.1/nfsd-clean-up-nfsd4_init_file.patch
queue-6.1/nfsd-add-a-nfsd4_file_hash_remove-helper.patch
queue-6.1/nfsd-trace-delegation-revocations.patch
queue-6.1/nfsd-allow-disabling-nfsv2-at-compile-time.patch
queue-6.1/nfsd-flesh-out-a-documenting-comment-for-filecache.c.patch
queue-6.1/nfsd-replace-delayed_work-with-work_struct-for-nfsd_client_shrinker.patch
queue-6.1/lockd-set-missing-fl_flags-field-when-retrieving-args.patch
queue-6.1/filelock-add-a-new-locks_inode_context-accessor-function.patch
queue-6.1/lockd-fix-file-selection-in-nlmsvc_cancel_blocked.patch
queue-6.1/nfsd-avoid-clashing-function-prototypes.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux