Skip to contentSkip to conversation

sunrpc: Fix RFC6803 encryption test

PATCH In review David Howells 3 participants 4 messages Apr 13, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunrpc: Fix RFC6803 encryption test

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")
cc Chuck Lever <[email protected]>
cc Scott Mayhew <[email protected]>
cc Herbert Xu <[email protected]>
---
 net/sunrpc/auth_gss/gss_krb5_test.c |    1 +
 1 file changed, 1 insertion(+)
net/sunrpc/auth_gss/gss_krb5_test.c +1 -0
index ce0541e32fc9..aa6ec4e858aa 100644
@@ -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;
#1 lore raw
Quoted 26 lines · David Howells

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")
cc Chuck Lever <[email protected]>
cc Scott Mayhew <[email protected]>
cc Herbert Xu <[email protected]>

---
net/sunrpc/auth_gss/gss_krb5_test.c | 1 +

1 file changed, 1 insertion(+)
net/sunrpc/auth_gss/gss_krb5_test.c +0 -0
index ce0541e32fc9..aa6ec4e858aa 100644

net/sunrpc/auth_gss/gss_krb5_test.c static void rfc6803_encrypt_case(struct kunit *test) · line 1333

Quoted 7 lines
net/sunrpc/auth_gss/gss_krb5_test.c +1 -0
@@ -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

#2 lore raw
In reply to David Howells
Quoted 22 lines · David Howells

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")
cc Chuck Lever <[email protected]>
cc Scott Mayhew <[email protected]>
cc Herbert Xu <[email protected]>
---
 net/sunrpc/auth_gss/gss_krb5_test.c |    1 +
 1 file changed, 1 insertion(+)
net/sunrpc/auth_gss/gss_krb5_test.c +0 -0
index ce0541e32fc9..aa6ec4e858aa 100644

net/sunrpc/auth_gss/gss_krb5_test.c static void rfc6803_encrypt_case(struct kunit *test) · line 1333

Quoted 7 lines
net/sunrpc/auth_gss/gss_krb5_test.c +1 -0
@@ -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

#3 lore raw
Quoted 3 lines · Scott Mayhew

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