linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd: depend on CRYPTO_MD5 for legacy client tracking
@ 2019-12-03  6:52 Patrick Steinhardt
  2019-12-03 16:50 ` Chuck Lever
  2019-12-04  6:13 ` [PATCH v2] " Patrick Steinhardt
  0 siblings, 2 replies; 4+ messages in thread
From: Patrick Steinhardt @ 2019-12-03  6:52 UTC (permalink / raw)
  To: linux-nfs; +Cc: Patrick Steinhardt, Chuck Lever, J. Bruce Fields

The legacy client tracking infrastructure of nfsd makes use of MD5 to
derive a client's recovery directory name. As the nfsd module doesn't
declare any dependency on CRYPTO_MD5, though, it may fail to allocate
the hash if the kernel was compiled without it. As a result, generation
of client recovery directories will fail with the following error:

    NFSD: unable to generate recoverydir name

The dependency was removed as a seemingly redundant dependency back in
6aaa67b5f3b9 (NFSD: Remove redundant "select" clauses in fs/Kconfig
2008-02-11). But in fact, even then the MD5 module was pulled in only
when RPCSEC_GSS_KRB5 or RPCSEC_GSS_KRB5 was selected.

Fix the issue by adding back an explicit dependency on CRYPTO_MD5.

Fixes: 6aaa67b5f3b9 (NFSD: Remove redundant "select" clauses in fs/Kconfig)
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 fs/nfsd/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
index c4b1a89b8845..f2f81561ebb6 100644
--- a/fs/nfsd/Kconfig
+++ b/fs/nfsd/Kconfig
@@ -73,6 +73,7 @@ config NFSD_V4
 	select NFSD_V3
 	select FS_POSIX_ACL
 	select SUNRPC_GSS
+	select CRYPTO_MD5
 	select CRYPTO_SHA256
 	select GRACE_PERIOD
 	help
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nfsd: depend on CRYPTO_MD5 for legacy client tracking
  2019-12-03  6:52 [PATCH] nfsd: depend on CRYPTO_MD5 for legacy client tracking Patrick Steinhardt
@ 2019-12-03 16:50 ` Chuck Lever
  2019-12-04  6:13 ` [PATCH v2] " Patrick Steinhardt
  1 sibling, 0 replies; 4+ messages in thread
From: Chuck Lever @ 2019-12-03 16:50 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: Linux NFS Mailing List, Bruce Fields

Hi Patrick-

> On Dec 3, 2019, at 1:52 AM, Patrick Steinhardt <ps@pks.im> wrote:
> 
> The legacy client tracking infrastructure of nfsd makes use of MD5 to
> derive a client's recovery directory name. As the nfsd module doesn't
> declare any dependency on CRYPTO_MD5, though, it may fail to allocate
> the hash if the kernel was compiled without it. As a result, generation
> of client recovery directories will fail with the following error:
> 
>    NFSD: unable to generate recoverydir name
> 
> The dependency was removed as a seemingly redundant dependency back in
> 6aaa67b5f3b9 (NFSD: Remove redundant "select" clauses in fs/Kconfig
> 2008-02-11). But in fact, even then the MD5 module was pulled in only
> when RPCSEC_GSS_KRB5 or RPCSEC_GSS_KRB5 was selected.
> 
> Fix the issue by adding back an explicit dependency on CRYPTO_MD5.
> 
> Fixes: 6aaa67b5f3b9 (NFSD: Remove redundant "select" clauses in fs/Kconfig)

Just a quibble with your Fixes: tag.

At that time, selecting NFSv4 support did bring in CRYPTO, because
NFSv4 support always selected RPCSEC_GSS_KRB5.

It was a later commit that removed RPCSEC_GSS_KRB5:

df486a25900f ("NFS: Fix the selection of security flavours in Kconfig")


> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> fs/nfsd/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
> index c4b1a89b8845..f2f81561ebb6 100644
> --- a/fs/nfsd/Kconfig
> +++ b/fs/nfsd/Kconfig
> @@ -73,6 +73,7 @@ config NFSD_V4
> 	select NFSD_V3
> 	select FS_POSIX_ACL
> 	select SUNRPC_GSS
> +	select CRYPTO_MD5
> 	select CRYPTO_SHA256
> 	select GRACE_PERIOD
> 	help
> -- 
> 2.24.0
> 

--
Chuck Lever




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] nfsd: depend on CRYPTO_MD5 for legacy client tracking
  2019-12-03  6:52 [PATCH] nfsd: depend on CRYPTO_MD5 for legacy client tracking Patrick Steinhardt
  2019-12-03 16:50 ` Chuck Lever
@ 2019-12-04  6:13 ` Patrick Steinhardt
  2019-12-06 21:03   ` J. Bruce Fields
  1 sibling, 1 reply; 4+ messages in thread
From: Patrick Steinhardt @ 2019-12-04  6:13 UTC (permalink / raw)
  To: linux-nfs; +Cc: Patrick Steinhardt, Chuck Lever, J. Bruce Fields

The legacy client tracking infrastructure of nfsd makes use of MD5 to
derive a client's recovery directory name. As the nfsd module doesn't
declare any dependency on CRYPTO_MD5, though, it may fail to allocate
the hash if the kernel was compiled without it. As a result, generation
of client recovery directories will fail with the following error:

    NFSD: unable to generate recoverydir name

The explicit dependency on CRYPTO_MD5 was removed as redundant back in
6aaa67b5f3b9 (NFSD: Remove redundant "select" clauses in fs/Kconfig
2008-02-11) as it was already implicitly selected via RPCSEC_GSS_KRB5.
This broke when RPCSEC_GSS_KRB5 was made optional for NFSv4 in commit
df486a25900f (NFS: Fix the selection of security flavours in Kconfig) at
a later point.

Fix the issue by adding back an explicit dependency on CRYPTO_MD5.

Fixes: df486a25900f (NFS: Fix the selection of security flavours in Kconfig)
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---

The only change compared to v1 is in the commit message. As
pointed out by Chuck, it wasn't actually commit 6aaa67b5f3b9
which broke it, but the later df486a25900f. I've reworded the
commit message and fixed the Fixes tag to account for that.

 fs/nfsd/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
index c4b1a89b8845..f2f81561ebb6 100644
--- a/fs/nfsd/Kconfig
+++ b/fs/nfsd/Kconfig
@@ -73,6 +73,7 @@ config NFSD_V4
 	select NFSD_V3
 	select FS_POSIX_ACL
 	select SUNRPC_GSS
+	select CRYPTO_MD5
 	select CRYPTO_SHA256
 	select GRACE_PERIOD
 	help
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] nfsd: depend on CRYPTO_MD5 for legacy client tracking
  2019-12-04  6:13 ` [PATCH v2] " Patrick Steinhardt
@ 2019-12-06 21:03   ` J. Bruce Fields
  0 siblings, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2019-12-06 21:03 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: linux-nfs, Chuck Lever

Thanks, applied your v2.

--b.

On Wed, Dec 04, 2019 at 07:13:22AM +0100, Patrick Steinhardt wrote:
> The legacy client tracking infrastructure of nfsd makes use of MD5 to
> derive a client's recovery directory name. As the nfsd module doesn't
> declare any dependency on CRYPTO_MD5, though, it may fail to allocate
> the hash if the kernel was compiled without it. As a result, generation
> of client recovery directories will fail with the following error:
> 
>     NFSD: unable to generate recoverydir name
> 
> The explicit dependency on CRYPTO_MD5 was removed as redundant back in
> 6aaa67b5f3b9 (NFSD: Remove redundant "select" clauses in fs/Kconfig
> 2008-02-11) as it was already implicitly selected via RPCSEC_GSS_KRB5.
> This broke when RPCSEC_GSS_KRB5 was made optional for NFSv4 in commit
> df486a25900f (NFS: Fix the selection of security flavours in Kconfig) at
> a later point.
> 
> Fix the issue by adding back an explicit dependency on CRYPTO_MD5.
> 
> Fixes: df486a25900f (NFS: Fix the selection of security flavours in Kconfig)
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> 
> The only change compared to v1 is in the commit message. As
> pointed out by Chuck, it wasn't actually commit 6aaa67b5f3b9
> which broke it, but the later df486a25900f. I've reworded the
> commit message and fixed the Fixes tag to account for that.
> 
>  fs/nfsd/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
> index c4b1a89b8845..f2f81561ebb6 100644
> --- a/fs/nfsd/Kconfig
> +++ b/fs/nfsd/Kconfig
> @@ -73,6 +73,7 @@ config NFSD_V4
>  	select NFSD_V3
>  	select FS_POSIX_ACL
>  	select SUNRPC_GSS
> +	select CRYPTO_MD5
>  	select CRYPTO_SHA256
>  	select GRACE_PERIOD
>  	help
> -- 
> 2.24.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-06 21:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03  6:52 [PATCH] nfsd: depend on CRYPTO_MD5 for legacy client tracking Patrick Steinhardt
2019-12-03 16:50 ` Chuck Lever
2019-12-04  6:13 ` [PATCH v2] " Patrick Steinhardt
2019-12-06 21:03   ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).