linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SUNRPC: Ensure test case arrays are properly terminated
@ 2023-02-27 16:52 Chuck Lever
  2023-02-27 19:43 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Chuck Lever @ 2023-02-27 16:52 UTC (permalink / raw)
  To: geert; +Cc: linux-nfs, linux-kselftest, linux-m68k

From: Chuck Lever <chuck.lever@oracle.com>

Geert Uytterhoeven reports:

...
        ok 9 Encrypt 13 bytes with camellia256-cts-cmac
        ok 10 Encrypt 30 bytes with camellia256-cts-cmac
    # RFC 6803 encryption: pass:0 fail:0 skip:10 total:10
    ok 3 RFC 6803 encryption # SKIP Encryption type is not available
8<--- cut here ---
Unable to handle kernel paging request at virtual address 73657420 when execute
[73657420] *pgd=00000000
Internal error: Oops: 80000005 [#1] ARM
CPU: 0 PID: 1 Comm: swapper Tainted: G                 N 6.2.0-rc7-00133-g373f26a81164-dirty #9
Hardware name: Generic DT based system
PC is at 0x73657420
LR is at kunit_run_tests+0x3e0/0x5f4

On x86 with GCC 12, the missing array terminators did not seem to
matter. Other platforms appear to be more picky.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/auth_gss/gss_krb5_test.c |    5 +++++
 1 file changed, 5 insertions(+)

Hi Geert -

Finally able to reproduce. This simple patch seems to address the
crashes for me. If this patch fixes it for you I can push it to
Linus before the v6.3 merge window closes.


diff --git a/net/sunrpc/auth_gss/gss_krb5_test.c b/net/sunrpc/auth_gss/gss_krb5_test.c
index 0a7c5280e4e3..ce0541e32fc9 100644
--- a/net/sunrpc/auth_gss/gss_krb5_test.c
+++ b/net/sunrpc/auth_gss/gss_krb5_test.c
@@ -519,6 +519,7 @@ static struct kunit_case rfc3961_test_cases[] = {
 		.run_case		= kdf_case,
 		.generate_params	= rfc3961_kdf_gen_params,
 	},
+	{}
 };
 
 static struct kunit_suite rfc3961_suite = {
@@ -780,6 +781,7 @@ static struct kunit_case rfc3962_test_cases[] = {
 		.run_case		= rfc3962_encrypt_case,
 		.generate_params	= rfc3962_encrypt_gen_params,
 	},
+	{}
 };
 
 static struct kunit_suite rfc3962_suite = {
@@ -1415,6 +1417,7 @@ static struct kunit_case rfc6803_test_cases[] = {
 		.run_case		= rfc6803_encrypt_case,
 		.generate_params	= rfc6803_encrypt_gen_params,
 	},
+	{}
 };
 
 static struct kunit_suite rfc6803_suite = {
@@ -1907,6 +1910,7 @@ static struct kunit_case rfc8009_test_cases[] = {
 		.run_case		= rfc8009_encrypt_case,
 		.generate_params	= rfc8009_encrypt_gen_params,
 	},
+	{}
 };
 
 static struct kunit_suite rfc8009_suite = {
@@ -2029,6 +2033,7 @@ static struct kunit_case encryption_test_cases[] = {
 		.run_case		= encrypt_selftest_case,
 		.generate_params	= encrypt_selftest_gen_params,
 	},
+	{}
 };
 
 static struct kunit_suite encryption_test_suite = {



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

* Re: [PATCH] SUNRPC: Ensure test case arrays are properly terminated
  2023-02-27 16:52 [PATCH] SUNRPC: Ensure test case arrays are properly terminated Chuck Lever
@ 2023-02-27 19:43 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2023-02-27 19:43 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs, linux-kselftest, linux-m68k

Hi Chuck,

On Mon, Feb 27, 2023 at 5:53 PM Chuck Lever <cel@kernel.org> wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
>
> Geert Uytterhoeven reports:
>
> ...
>         ok 9 Encrypt 13 bytes with camellia256-cts-cmac
>         ok 10 Encrypt 30 bytes with camellia256-cts-cmac
>     # RFC 6803 encryption: pass:0 fail:0 skip:10 total:10
>     ok 3 RFC 6803 encryption # SKIP Encryption type is not available
> 8<--- cut here ---
> Unable to handle kernel paging request at virtual address 73657420 when execute
> [73657420] *pgd=00000000
> Internal error: Oops: 80000005 [#1] ARM
> CPU: 0 PID: 1 Comm: swapper Tainted: G                 N 6.2.0-rc7-00133-g373f26a81164-dirty #9
> Hardware name: Generic DT based system
> PC is at 0x73657420
> LR is at kunit_run_tests+0x3e0/0x5f4
>
> On x86 with GCC 12, the missing array terminators did not seem to
> matter. Other platforms appear to be more picky.

Doesn't gcc on x86 align all arrays to a 16-byte boundary, hence
adding zero-padding here?

>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2023-02-27 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 16:52 [PATCH] SUNRPC: Ensure test case arrays are properly terminated Chuck Lever
2023-02-27 19:43 ` Geert Uytterhoeven

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).