mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tests/module/gen_test_kallsyms.sh: use 0 value for variables
@ 2024-11-06  0:24 Luis Chamberlain
  2024-11-06 18:46 ` Sami Tolvanen
  0 siblings, 1 reply; 3+ messages in thread
From: Luis Chamberlain @ 2024-11-06  0:24 UTC (permalink / raw)
  To: linux-modules, linux-kernel, petr.pavlu, samitolvanen, da.gomez
  Cc: masahiroy, deller, linux-arch, live-patching, mcgrof, kris.van.hees

Use 0 for the values as we use them for the return value on init
to keep the test modules simple. This fixes a splat reported

do_init_module: 'test_kallsyms_b'->init suspiciously returned 255, it should follow 0/-E convention
do_init_module: loading module anyway...
CPU: 5 UID: 0 PID: 1873 Comm: modprobe Not tainted 6.12.0-rc3+ #4
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 2024.08-1 09/18/2024
Call Trace:
 <TASK>
 dump_stack_lvl+0x56/0x80
 do_init_module.cold+0x21/0x26
 init_module_from_file+0x88/0xf0
 idempotent_init_module+0x108/0x300
 __x64_sys_finit_module+0x5a/0xb0
 do_syscall_64+0x4b/0x110
 entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7f4f3a718839
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff>
RSP: 002b:00007fff97d1a9e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
RAX: ffffffffffffffda RBX: 000055b94001ab90 RCX: 00007f4f3a718839
RDX: 0000000000000000 RSI: 000055b910e68a10 RDI: 0000000000000004
RBP: 0000000000000000 R08: 00007f4f3a7f1b20 R09: 000055b94001c5b0
R10: 0000000000000040 R11: 0000000000000246 R12: 000055b910e68a10
R13: 0000000000040000 R14: 000055b94001ad60 R15: 0000000000000000
 </TASK>
do_init_module: 'test_kallsyms_b'->init suspiciously returned 255, it should follow 0/-E convention
do_init_module: loading module anyway...
CPU: 1 UID: 0 PID: 1884 Comm: modprobe Not tainted 6.12.0-rc3+ #4
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 2024.08-1 09/18/2024
Call Trace:
 <TASK>
 dump_stack_lvl+0x56/0x80
 do_init_module.cold+0x21/0x26
 init_module_from_file+0x88/0xf0
 idempotent_init_module+0x108/0x300
 __x64_sys_finit_module+0x5a/0xb0
 do_syscall_64+0x4b/0x110
 entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7ffaa5d18839

Reported-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 lib/tests/module/gen_test_kallsyms.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tests/module/gen_test_kallsyms.sh b/lib/tests/module/gen_test_kallsyms.sh
index ae5966f1f904..3f2c626350ad 100755
--- a/lib/tests/module/gen_test_kallsyms.sh
+++ b/lib/tests/module/gen_test_kallsyms.sh
@@ -32,7 +32,7 @@ gen_num_syms()
 	PREFIX=$1
 	NUM=$2
 	for i in $(seq 1 $NUM); do
-		printf "int auto_test_%s_%010d = 0xff;\n" $PREFIX $i
+		printf "int auto_test_%s_%010d = 0;\n" $PREFIX $i
 		printf "EXPORT_SYMBOL_GPL(auto_test_%s_%010d);\n" $PREFIX $i
 	done
 	echo
-- 
2.45.2


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

* Re: [PATCH] tests/module/gen_test_kallsyms.sh: use 0 value for variables
  2024-11-06  0:24 [PATCH] tests/module/gen_test_kallsyms.sh: use 0 value for variables Luis Chamberlain
@ 2024-11-06 18:46 ` Sami Tolvanen
  2024-11-07 22:33   ` Luis Chamberlain
  0 siblings, 1 reply; 3+ messages in thread
From: Sami Tolvanen @ 2024-11-06 18:46 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: linux-modules, linux-kernel, petr.pavlu, da.gomez, masahiroy,
	deller, linux-arch, live-patching, kris.van.hees

Hi Luis,

On Wed, Nov 6, 2024 at 12:24 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
>
> Use 0 for the values as we use them for the return value on init
> to keep the test modules simple. This fixes a splat reported
>
> do_init_module: 'test_kallsyms_b'->init suspiciously returned 255, it should follow 0/-E convention
> do_init_module: loading module anyway...
> CPU: 5 UID: 0 PID: 1873 Comm: modprobe Not tainted 6.12.0-rc3+ #4
> Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 2024.08-1 09/18/2024
> Call Trace:
>  <TASK>
>  dump_stack_lvl+0x56/0x80
>  do_init_module.cold+0x21/0x26
>  init_module_from_file+0x88/0xf0
>  idempotent_init_module+0x108/0x300
>  __x64_sys_finit_module+0x5a/0xb0
>  do_syscall_64+0x4b/0x110
>  entry_SYSCALL_64_after_hwframe+0x76/0x7e
> RIP: 0033:0x7f4f3a718839
> Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff>
> RSP: 002b:00007fff97d1a9e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
> RAX: ffffffffffffffda RBX: 000055b94001ab90 RCX: 00007f4f3a718839
> RDX: 0000000000000000 RSI: 000055b910e68a10 RDI: 0000000000000004
> RBP: 0000000000000000 R08: 00007f4f3a7f1b20 R09: 000055b94001c5b0
> R10: 0000000000000040 R11: 0000000000000246 R12: 000055b910e68a10
> R13: 0000000000040000 R14: 000055b94001ad60 R15: 0000000000000000
>  </TASK>
> do_init_module: 'test_kallsyms_b'->init suspiciously returned 255, it should follow 0/-E convention
> do_init_module: loading module anyway...
> CPU: 1 UID: 0 PID: 1884 Comm: modprobe Not tainted 6.12.0-rc3+ #4
> Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 2024.08-1 09/18/2024
> Call Trace:
>  <TASK>
>  dump_stack_lvl+0x56/0x80
>  do_init_module.cold+0x21/0x26
>  init_module_from_file+0x88/0xf0
>  idempotent_init_module+0x108/0x300
>  __x64_sys_finit_module+0x5a/0xb0
>  do_syscall_64+0x4b/0x110
>  entry_SYSCALL_64_after_hwframe+0x76/0x7e
> RIP: 0033:0x7ffaa5d18839
>
> Reported-by: Sami Tolvanen <samitolvanen@google.com>
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
>  lib/tests/module/gen_test_kallsyms.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/tests/module/gen_test_kallsyms.sh b/lib/tests/module/gen_test_kallsyms.sh
> index ae5966f1f904..3f2c626350ad 100755
> --- a/lib/tests/module/gen_test_kallsyms.sh
> +++ b/lib/tests/module/gen_test_kallsyms.sh
> @@ -32,7 +32,7 @@ gen_num_syms()
>         PREFIX=$1
>         NUM=$2
>         for i in $(seq 1 $NUM); do
> -               printf "int auto_test_%s_%010d = 0xff;\n" $PREFIX $i
> +               printf "int auto_test_%s_%010d = 0;\n" $PREFIX $i
>                 printf "EXPORT_SYMBOL_GPL(auto_test_%s_%010d);\n" $PREFIX $i
>         done
>         echo

Looks good to me. Thanks!

Reviewed-by: Sami Tolvanen <samitolvanen@google.com>

Sami

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

* Re: [PATCH] tests/module/gen_test_kallsyms.sh: use 0 value for variables
  2024-11-06 18:46 ` Sami Tolvanen
@ 2024-11-07 22:33   ` Luis Chamberlain
  0 siblings, 0 replies; 3+ messages in thread
From: Luis Chamberlain @ 2024-11-07 22:33 UTC (permalink / raw)
  To: Sami Tolvanen
  Cc: linux-modules, linux-kernel, petr.pavlu, da.gomez, masahiroy,
	deller, linux-arch, live-patching, kris.van.hees

On Wed, Nov 06, 2024 at 06:46:48PM +0000, Sami Tolvanen wrote:
> Hi Luis,
> 
> On Wed, Nov 6, 2024 at 12:24 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
> >
> > Use 0 for the values as we use them for the return value on init
> > to keep the test modules simple. This fixes a splat reported
> >
> > do_init_module: 'test_kallsyms_b'->init suspiciously returned 255, it should follow 0/-E convention
> > do_init_module: loading module anyway...
> > CPU: 5 UID: 0 PID: 1873 Comm: modprobe Not tainted 6.12.0-rc3+ #4
> > Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 2024.08-1 09/18/2024
> > Call Trace:
> >  <TASK>
> >  dump_stack_lvl+0x56/0x80
> >  do_init_module.cold+0x21/0x26
> >  init_module_from_file+0x88/0xf0
> >  idempotent_init_module+0x108/0x300
> >  __x64_sys_finit_module+0x5a/0xb0
> >  do_syscall_64+0x4b/0x110
> >  entry_SYSCALL_64_after_hwframe+0x76/0x7e
> > RIP: 0033:0x7f4f3a718839
> > Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff>
> > RSP: 002b:00007fff97d1a9e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
> > RAX: ffffffffffffffda RBX: 000055b94001ab90 RCX: 00007f4f3a718839
> > RDX: 0000000000000000 RSI: 000055b910e68a10 RDI: 0000000000000004
> > RBP: 0000000000000000 R08: 00007f4f3a7f1b20 R09: 000055b94001c5b0
> > R10: 0000000000000040 R11: 0000000000000246 R12: 000055b910e68a10
> > R13: 0000000000040000 R14: 000055b94001ad60 R15: 0000000000000000
> >  </TASK>
> > do_init_module: 'test_kallsyms_b'->init suspiciously returned 255, it should follow 0/-E convention
> > do_init_module: loading module anyway...
> > CPU: 1 UID: 0 PID: 1884 Comm: modprobe Not tainted 6.12.0-rc3+ #4
> > Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 2024.08-1 09/18/2024
> > Call Trace:
> >  <TASK>
> >  dump_stack_lvl+0x56/0x80
> >  do_init_module.cold+0x21/0x26
> >  init_module_from_file+0x88/0xf0
> >  idempotent_init_module+0x108/0x300
> >  __x64_sys_finit_module+0x5a/0xb0
> >  do_syscall_64+0x4b/0x110
> >  entry_SYSCALL_64_after_hwframe+0x76/0x7e
> > RIP: 0033:0x7ffaa5d18839
> >
> > Reported-by: Sami Tolvanen <samitolvanen@google.com>
> > Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> > ---
> >  lib/tests/module/gen_test_kallsyms.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/tests/module/gen_test_kallsyms.sh b/lib/tests/module/gen_test_kallsyms.sh
> > index ae5966f1f904..3f2c626350ad 100755
> > --- a/lib/tests/module/gen_test_kallsyms.sh
> > +++ b/lib/tests/module/gen_test_kallsyms.sh
> > @@ -32,7 +32,7 @@ gen_num_syms()
> >         PREFIX=$1
> >         NUM=$2
> >         for i in $(seq 1 $NUM); do
> > -               printf "int auto_test_%s_%010d = 0xff;\n" $PREFIX $i
> > +               printf "int auto_test_%s_%010d = 0;\n" $PREFIX $i
> >                 printf "EXPORT_SYMBOL_GPL(auto_test_%s_%010d);\n" $PREFIX $i
> >         done
> >         echo
> 
> Looks good to me. Thanks!
> 
> Reviewed-by: Sami Tolvanen <samitolvanen@google.com>

Merged, thanks.

  Luis

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

end of thread, other threads:[~2024-11-07 22:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-06  0:24 [PATCH] tests/module/gen_test_kallsyms.sh: use 0 value for variables Luis Chamberlain
2024-11-06 18:46 ` Sami Tolvanen
2024-11-07 22:33   ` Luis Chamberlain

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

all inboxes | Powered by JetHome®