public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sunrpc: Fix RFC6803 encryption test
@ 2023-04-13 13:51 David Howells
  2023-04-13 13:58 ` Chuck Lever III
  2023-04-13 14:37 ` Scott Mayhew
  0 siblings, 2 replies; 4+ messages in thread
From: David Howells @ 2023-04-13 13:51 UTC (permalink / raw)
  To: Chuck Lever
  Cc: dhowells, Scott Mayhew, Herbert Xu, linux-nfs, linux-crypto,
	linux-kernel

    
The usage_data[] array in rfc6803_encrypt_case() is uninitialised, so clear
it as it may cause the tests to fail otherwise.

Fixes: b958cff6b27b ("SUNRPC: Add encryption KUnit tests for the RFC 6803 encryption types")
Link: https://lore.kernel.org/r/380323.1681314997@warthog.procyon.org.uk/
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Chuck Lever <chuck.lever@oracle.com>
cc: Scott Mayhew <smayhew@redhat.com>
cc: Herbert Xu <herbert@gondor.apana.org.au>
cc: linux-nfs@vger.kernel.org
cc: linux-crypto@vger.kernel.org
---
 net/sunrpc/auth_gss/gss_krb5_test.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sunrpc/auth_gss/gss_krb5_test.c b/net/sunrpc/auth_gss/gss_krb5_test.c
index ce0541e32fc9..aa6ec4e858aa 100644
--- a/net/sunrpc/auth_gss/gss_krb5_test.c
+++ b/net/sunrpc/auth_gss/gss_krb5_test.c
@@ -1327,6 +1327,7 @@ static void rfc6803_encrypt_case(struct kunit *test)
 	if (!gk5e)
 		kunit_skip(test, "Encryption type is not available");
 
+	memset(usage_data, 0, sizeof(usage_data));
 	usage.data[3] = param->constant;
 
 	Ke.len = gk5e->Ke_length;


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

* Re: [PATCH] sunrpc: Fix RFC6803 encryption test
  2023-04-13 13:51 [PATCH] sunrpc: Fix RFC6803 encryption test David Howells
@ 2023-04-13 13:58 ` Chuck Lever III
  2023-04-13 14:37 ` Scott Mayhew
  1 sibling, 0 replies; 4+ messages in thread
From: Chuck Lever III @ 2023-04-13 13:58 UTC (permalink / raw)
  To: David Howells
  Cc: Scott Mayhew, Herbert Xu, Linux NFS Mailing List,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org



> On Apr 13, 2023, at 9:51 AM, David Howells <dhowells@redhat.com> wrote:
> 
> 
> The usage_data[] array in rfc6803_encrypt_case() is uninitialised, so clear
> it as it may cause the tests to fail otherwise.
> 
> Fixes: b958cff6b27b ("SUNRPC: Add encryption KUnit tests for the RFC 6803 encryption types")
> Link: https://lore.kernel.org/r/380323.1681314997@warthog.procyon.org.uk/
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Chuck Lever <chuck.lever@oracle.com>
> cc: Scott Mayhew <smayhew@redhat.com>
> cc: Herbert Xu <herbert@gondor.apana.org.au>
> cc: linux-nfs@vger.kernel.org
> cc: linux-crypto@vger.kernel.org
> ---
> net/sunrpc/auth_gss/gss_krb5_test.c |    1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/net/sunrpc/auth_gss/gss_krb5_test.c b/net/sunrpc/auth_gss/gss_krb5_test.c
> index ce0541e32fc9..aa6ec4e858aa 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_test.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_test.c
> @@ -1327,6 +1327,7 @@ static void rfc6803_encrypt_case(struct kunit *test)
> if (!gk5e)
> kunit_skip(test, "Encryption type is not available");
> 
> + memset(usage_data, 0, sizeof(usage_data));
> usage.data[3] = param->constant;
> 
> Ke.len = gk5e->Ke_length;
> 

Many thanks! I will apply this to nfsd-fixes.


--
Chuck Lever



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

* Re: [PATCH] sunrpc: Fix RFC6803 encryption test
  2023-04-13 13:51 [PATCH] sunrpc: Fix RFC6803 encryption test David Howells
  2023-04-13 13:58 ` Chuck Lever III
@ 2023-04-13 14:37 ` Scott Mayhew
  2023-04-13 15:11   ` David Howells
  1 sibling, 1 reply; 4+ messages in thread
From: Scott Mayhew @ 2023-04-13 14:37 UTC (permalink / raw)
  To: David Howells
  Cc: Chuck Lever, Herbert Xu, linux-nfs, linux-crypto, linux-kernel

On Thu, 13 Apr 2023, David Howells wrote:

>     
> The usage_data[] array in rfc6803_encrypt_case() is uninitialised, so clear
> it as it may cause the tests to fail otherwise.
> 
> Fixes: b958cff6b27b ("SUNRPC: Add encryption KUnit tests for the RFC 6803 encryption types")
> Link: https://lore.kernel.org/r/380323.1681314997@warthog.procyon.org.uk/
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Chuck Lever <chuck.lever@oracle.com>
> cc: Scott Mayhew <smayhew@redhat.com>
> cc: Herbert Xu <herbert@gondor.apana.org.au>
> cc: linux-nfs@vger.kernel.org
> cc: linux-crypto@vger.kernel.org
> ---
>  net/sunrpc/auth_gss/gss_krb5_test.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/sunrpc/auth_gss/gss_krb5_test.c b/net/sunrpc/auth_gss/gss_krb5_test.c
> index ce0541e32fc9..aa6ec4e858aa 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_test.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_test.c
> @@ -1327,6 +1327,7 @@ static void rfc6803_encrypt_case(struct kunit *test)
>  	if (!gk5e)
>  		kunit_skip(test, "Encryption type is not available");
>  
> +	memset(usage_data, 0, sizeof(usage_data));
>  	usage.data[3] = param->constant;
>  
>  	Ke.len = gk5e->Ke_length;
> 

I still see the failures with this patch applied.  The rfc6803 checksum
tests run before the rfc6803 encryption tests, so I'm not sure how this
would help.

-Scott


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

* Re: [PATCH] sunrpc: Fix RFC6803 encryption test
  2023-04-13 14:37 ` Scott Mayhew
@ 2023-04-13 15:11   ` David Howells
  0 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2023-04-13 15:11 UTC (permalink / raw)
  To: Scott Mayhew
  Cc: dhowells, Chuck Lever, Herbert Xu, linux-nfs, linux-crypto,
	linux-kernel

Scott Mayhew <smayhew@redhat.com> wrote:

> I still see the failures with this patch applied.  The rfc6803 checksum
> tests run before the rfc6803 encryption tests, so I'm not sure how this
> would help.

It fixes the failure I was getting; it doesn't mean there aren't other bugs.

David


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

end of thread, other threads:[~2023-04-13 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-13 13:51 [PATCH] sunrpc: Fix RFC6803 encryption test David Howells
2023-04-13 13:58 ` Chuck Lever III
2023-04-13 14:37 ` Scott Mayhew
2023-04-13 15:11   ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox