Patrick Ho 1d625050c7 nfsd: fix error handling of register_pernet_subsys() in init_nfsd()
init_nfsd() should not unregister pernet subsys if the register fails
but should instead unwind from the last successful operation which is
register_filesystem().

Unregistering a failed register_pernet_subsys() call can result in
a kernel GPF as revealed by programmatically injecting an error in
register_pernet_subsys().

Verified the fix handled failure gracefully with no lingering nfsd
entry in /proc/filesystems.  This change was introduced by the commit
bd5ae9288d64 ("nfsd: register pernet ops last, unregister first"),
the original error handling logic was correct.

Fixes: bd5ae9288d64 ("nfsd: register pernet ops last, unregister first")
Cc: stable@vger.kernel.org
Signed-off-by: Patrick Ho <Patrick.Ho@netapp.com>
Acked-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-09-30 10:58:52 -04:00
..
2021-02-23 13:39:45 -08:00
2021-01-25 09:36:28 -05:00
2021-05-07 11:23:41 -07:00
2020-09-25 18:01:26 -04:00
2021-01-24 14:27:17 +01:00
2021-08-26 15:32:28 -04:00
2021-03-22 10:19:02 -04:00
2021-01-25 09:36:28 -05:00
2021-08-17 11:47:53 -04:00
2018-09-25 20:34:54 -04:00