mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [linus:master] [kasan]  a414d4286f: INFO:trying_to_register_non-static_key
@ 2024-01-11  7:29 kernel test robot
  2024-01-11 14:59 ` Tetsuo Handa
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2024-01-11  7:29 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: oe-lkp, lkp, linux-kernel, Andrew Morton, Tetsuo Handa,
	Marco Elver, Alexander Potapenko, Dmitry Vyukov,
	Evgenii Stepanov, Vlastimil Babka, kasan-dev, oliver.sang



Hello,

kernel test robot noticed "INFO:trying_to_register_non-static_key" on:

commit: a414d4286f3400aa05631c4931eb3feba83e29e8 ("kasan: handle concurrent kasan_record_aux_stack calls")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master

[test failed on linux-next/master 8cb47d7cd090a690c1785385b2f3d407d4a53ad0]

in testcase: boot

compiler: gcc-12
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G

(please refer to attached dmesg/kmsg for entire log/backtrace)


+----------------------------------------------------+------------+------------+
|                                                    | a914d8d6cf | a414d4286f |
+----------------------------------------------------+------------+------------+
| INFO:trying_to_register_non-static_key             | 0          | 22         |
+----------------------------------------------------+------------+------------+


If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202401111558.1374ae6f-oliver.sang@intel.com


[    1.582812][    T0] INFO: trying to register non-static key.
[    1.583305][    T0] The code is fine but needs lockdep annotation, or maybe
[    1.583887][    T0] you didn't initialize this object before use?
[    1.584409][    T0] turning off the locking correctness validator.
[    1.584930][    T0] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.7.0-rc4-00331-ga414d4286f34 #1
[    1.585652][    T0] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[    1.586518][    T0] Call Trace:
[    1.586782][    T0]  <TASK>
[ 1.587071][ T0] dump_stack_lvl (lib/dump_stack.c:107) 
[ 1.587449][ T0] register_lock_class (kernel/locking/lockdep.c:977 kernel/locking/lockdep.c:1289) 
[ 1.587885][ T0] ? is_dynamic_key (kernel/locking/lockdep.c:1276) 
[ 1.588290][ T0] __lock_acquire (kernel/locking/lockdep.c:5015) 
[ 1.588671][ T0] ? x86_64_start_reservations (arch/x86/kernel/head64.c:543) 
[ 1.589135][ T0] ? x86_64_start_kernel (arch/x86/kernel/head64.c:485 (discriminator 17)) 
[ 1.589562][ T0] ? secondary_startup_64_no_verify (arch/x86/kernel/head_64.S:432) 
[ 1.590077][ T0] lock_acquire (kernel/locking/lockdep.c:467 kernel/locking/lockdep.c:5756) 
[ 1.590449][ T0] ? __kasan_record_aux_stack (mm/kasan/generic.c:539) 
[ 1.590907][ T0] ? lock_sync (kernel/locking/lockdep.c:5722) 
[ 1.591269][ T0] _raw_spin_lock_irqsave (include/linux/spinlock_api_smp.h:111 kernel/locking/spinlock.c:162) 
[ 1.591698][ T0] ? __kasan_record_aux_stack (mm/kasan/generic.c:539) 
[ 1.592158][ T0] __kasan_record_aux_stack (mm/kasan/generic.c:539) 
[ 1.592598][ T0] ? mem_pool_free (mm/kmemleak.c:508) 
[ 1.592988][ T0] __call_rcu_common+0x6b/0x710 
[ 1.593475][ T0] slab_free_freelist_hook (mm/slub.c:1783 mm/slub.c:1837) 
[ 1.593923][ T0] ? apply_wqattrs_cleanup (kernel/workqueue.c:4329) 
[ 1.594370][ T0] __kmem_cache_free (mm/slub.c:3820 mm/slub.c:3833) 
[ 1.594770][ T0] ? do_raw_spin_unlock (arch/x86/include/asm/atomic.h:23 include/linux/atomic/atomic-arch-fallback.h:457 include/linux/atomic/atomic-instrumented.h:33 include/asm-generic/qspinlock.h:57 kernel/locking/spinlock_debug.c:100 kernel/locking/spinlock_debug.c:140) 
[ 1.595193][ T0] apply_wqattrs_cleanup (kernel/workqueue.c:4329) 
[ 1.595627][ T0] apply_workqueue_attrs_locked (kernel/workqueue.c:4452) 
[ 1.596103][ T0] alloc_and_link_pwqs (kernel/workqueue.c:4481 kernel/workqueue.c:4599) 
[ 1.596523][ T0] alloc_workqueue (kernel/workqueue.c:4724) 
[ 1.596910][ T0] ? workqueue_sysfs_register (kernel/workqueue.c:4675) 
[ 1.597380][ T0] workqueue_init_early (kernel/workqueue.c:6605 (discriminator 2)) 
[ 1.597809][ T0] ? workqueue_init_topology (kernel/workqueue.c:6531) 
[ 1.598273][ T0] ? kmem_cache_create_usercopy (mm/slab_common.c:363) 
[ 1.598752][ T0] start_kernel (init/main.c:965 (discriminator 3)) 
[ 1.599116][ T0] x86_64_start_reservations (arch/x86/kernel/head64.c:543) 
[ 1.599564][ T0] x86_64_start_kernel (arch/x86/kernel/head64.c:485 (discriminator 17)) 
[ 1.599981][ T0] secondary_startup_64_no_verify (arch/x86/kernel/head_64.S:432) 
[    1.600482][    T0]  </TASK>



The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20240111/202401111558.1374ae6f-oliver.sang@intel.com



-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


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

* Re: [linus:master] [kasan] a414d4286f: INFO:trying_to_register_non-static_key
  2024-01-11  7:29 [linus:master] [kasan] a414d4286f: INFO:trying_to_register_non-static_key kernel test robot
@ 2024-01-11 14:59 ` Tetsuo Handa
  2024-01-11 15:01   ` Andrey Konovalov
  2024-01-11 15:01   ` Marco Elver
  0 siblings, 2 replies; 4+ messages in thread
From: Tetsuo Handa @ 2024-01-11 14:59 UTC (permalink / raw)
  To: kernel test robot, Andrey Konovalov
  Cc: oe-lkp, lkp, linux-kernel, Andrew Morton, Marco Elver,
	Alexander Potapenko, Dmitry Vyukov, Evgenii Stepanov,
	Vlastimil Babka, kasan-dev

Commit a414d4286f34 ("kasan: handle concurrent kasan_record_aux_stack calls")
calls raw_spin_lock_init(&alloc_meta->aux_lock) after __memset() in
kasan_init_object_meta(), but does not call raw_spin_lock_init() after __memset()
in release_alloc_meta(), resulting in lock map information being zeroed out?

We should not zero out the whole sizeof(struct kasan_alloc_meta) bytes from
release_alloc_meta() in order not to undo raw_spin_lock_init() from
kasan_init_object_meta() ?

On 2024/01/11 16:29, kernel test robot wrote:
> [    1.582812][    T0] INFO: trying to register non-static key.
> [    1.583305][    T0] The code is fine but needs lockdep annotation, or maybe
> [    1.583887][    T0] you didn't initialize this object before use?
> [    1.584409][    T0] turning off the locking correctness validator.


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

* Re: [linus:master] [kasan] a414d4286f: INFO:trying_to_register_non-static_key
  2024-01-11 14:59 ` Tetsuo Handa
@ 2024-01-11 15:01   ` Andrey Konovalov
  2024-01-11 15:01   ` Marco Elver
  1 sibling, 0 replies; 4+ messages in thread
From: Andrey Konovalov @ 2024-01-11 15:01 UTC (permalink / raw)
  To: Tetsuo Handa, kernel test robot
  Cc: Andrey Konovalov, oe-lkp, lkp, linux-kernel, Andrew Morton,
	Marco Elver, Alexander Potapenko, Dmitry Vyukov,
	Evgenii Stepanov, Vlastimil Babka, kasan-dev

On Thu, Jan 11, 2024 at 4:00 PM Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
>
> Commit a414d4286f34 ("kasan: handle concurrent kasan_record_aux_stack calls")
> calls raw_spin_lock_init(&alloc_meta->aux_lock) after __memset() in
> kasan_init_object_meta(), but does not call raw_spin_lock_init() after __memset()
> in release_alloc_meta(), resulting in lock map information being zeroed out?
>
> We should not zero out the whole sizeof(struct kasan_alloc_meta) bytes from
> release_alloc_meta() in order not to undo raw_spin_lock_init() from
> kasan_init_object_meta() ?

Yes, already sent a fix:

https://lore.kernel.org/linux-mm/20240109221234.90929-1-andrey.konovalov@linux.dev/

Thank you!

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

* Re: [linus:master] [kasan] a414d4286f: INFO:trying_to_register_non-static_key
  2024-01-11 14:59 ` Tetsuo Handa
  2024-01-11 15:01   ` Andrey Konovalov
@ 2024-01-11 15:01   ` Marco Elver
  1 sibling, 0 replies; 4+ messages in thread
From: Marco Elver @ 2024-01-11 15:01 UTC (permalink / raw)
  To: Tetsuo Handa
  Cc: kernel test robot, Andrey Konovalov, oe-lkp, lkp, linux-kernel,
	Andrew Morton, Alexander Potapenko, Dmitry Vyukov,
	Evgenii Stepanov, Vlastimil Babka, kasan-dev

On Thu, 11 Jan 2024 at 16:00, Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
>
> Commit a414d4286f34 ("kasan: handle concurrent kasan_record_aux_stack calls")
> calls raw_spin_lock_init(&alloc_meta->aux_lock) after __memset() in
> kasan_init_object_meta(), but does not call raw_spin_lock_init() after __memset()
> in release_alloc_meta(), resulting in lock map information being zeroed out?
>
> We should not zero out the whole sizeof(struct kasan_alloc_meta) bytes from
> release_alloc_meta() in order not to undo raw_spin_lock_init() from
> kasan_init_object_meta() ?

Does this fix it:
https://lore.kernel.org/all/20240109221234.90929-1-andrey.konovalov@linux.dev/

> On 2024/01/11 16:29, kernel test robot wrote:
> > [    1.582812][    T0] INFO: trying to register non-static key.
> > [    1.583305][    T0] The code is fine but needs lockdep annotation, or maybe
> > [    1.583887][    T0] you didn't initialize this object before use?
> > [    1.584409][    T0] turning off the locking correctness validator.
>
> --
> You received this message because you are subscribed to the Google Groups "kasan-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/b1adbb1c-62b7-459f-a1bb-63774895fbb3%40I-love.SAKURA.ne.jp.

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

end of thread, other threads:[~2024-01-11 15:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11  7:29 [linus:master] [kasan] a414d4286f: INFO:trying_to_register_non-static_key kernel test robot
2024-01-11 14:59 ` Tetsuo Handa
2024-01-11 15:01   ` Andrey Konovalov
2024-01-11 15:01   ` Marco Elver

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®