================================ WARNING: inconsistent lock state 5.5.0-rc6-next-20200116-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor246/9796 [HC0[0]:SC1[1]:HE1:SE0] takes: ffffffff8a03ce58 (ima_keys_lock){+.?.}, at: spin_lock include/linux/spinlock.h:338 [inline] ffffffff8a03ce58 (ima_keys_lock){+.?.}, at: ima_process_queued_keys+0x4f/0x320 security/integrity/ima/ima_asymmetric_keys.c:144 {SOFTIRQ-ON-W} state was registered at: lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4484 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] ima_queue_key security/integrity/ima/ima_asymmetric_keys.c:111 [inline] ima_post_key_create_or_update+0x234/0x470 security/integrity/ima/ima_asymmetric_keys.c:194 key_create_or_update+0x6b8/0xcb0 security/keys/key.c:944 load_system_certificate_list+0x1ba/0x25e certs/system_keyring.c:161 do_one_initcall+0x120/0x820 init/main.c:1109 do_initcall_level init/main.c:1182 [inline] do_initcalls init/main.c:1198 [inline] do_basic_setup init/main.c:1218 [inline] kernel_init_freeable+0x522/0x5d0 init/main.c:1402 kernel_init+0x12/0x1bf init/main.c:1309 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 irq event stamp: 2739170 hardirqs last enabled at (2739170): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] hardirqs last enabled at (2739170): [] _raw_spin_unlock_irq+0x23/0x80 kernel/locking/spinlock.c:199 hardirqs last disabled at (2739169): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (2739169): [] _raw_spin_lock_irq+0x3a/0x80 kernel/locking/spinlock.c:167 softirqs last enabled at (2738838): [] memcpy include/linux/string.h:426 [inline] softirqs last enabled at (2738838): [] fpu__copy+0x17e/0x8c0 arch/x86/kernel/fpu/core.c:195 softirqs last disabled at (2739167): [] invoke_softirq kernel/softirq.c:373 [inline] softirqs last disabled at (2739167): [] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(ima_keys_lock); lock(ima_keys_lock); *** DEADLOCK *** 1 lock held by syz-executor246/9796: #0: ffffc90000007d50 ((&ima_key_queue_timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:172 [inline] #0: ffffc90000007d50 ((&ima_key_queue_timer)){+.-.}, at: call_timer_fn+0xe0/0x780 kernel/time/timer.c:1394 stack backtrace: CPU: 0 PID: 9796 Comm: syz-executor246 Not tainted 5.5.0-rc6-next-20200116-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x197/0x210 lib/dump_stack.c:118 print_usage_bug.cold+0x327/0x378 kernel/locking/lockdep.c:3100 valid_state kernel/locking/lockdep.c:3111 [inline] mark_lock_irq kernel/locking/lockdep.c:3308 [inline] mark_lock+0xbb4/0x1220 kernel/locking/lockdep.c:3665 mark_usage kernel/locking/lockdep.c:3565 [inline] __lock_acquire+0x1e8e/0x4a00 kernel/locking/lockdep.c:3908 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4484 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] ima_process_queued_keys+0x4f/0x320 security/integrity/ima/ima_asymmetric_keys.c:144 ima_timer_handler+0x15/0x20 security/integrity/ima/ima_asymmetric_keys.c:46 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x6c3/0x1790 kernel/time/timer.c:1786 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:update_stack_state+0x409/0x5f0 arch/x86/kernel/unwind_frame.c:204 Code: 00 48 c7 85 70 ff ff ff 10 00 00 00 e9 39 fd ff ff 49 8d 7d 38 48 b8 00 00 00 00 00 fc ff df 48 89 f9 48 c1 e9 03 80 3c 01 00 <0f> 85 b6 01 00 00 49 8b 45 38 48 83 c0 10 48 89 85 50 ff ff ff e9 RSP: 0018:ffffc90001f17538 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 1ffff920003e2ed3 RDX: 0000000000000002 RSI: ffffc90001f17650 RDI: ffffc90001f17698 RBP: ffffc90001f17600 R08: ffffc90001f17688 R09: ffffc90001f17660 R10: fffff520003e2ed7 R11: ffffc90001f176bf R12: 0000000000000000 R13: ffffc90001f17660 R14: 1ffff920003e2eaf R15: ffffc90001f17660 __unwind_start+0x189/0x3d0 arch/x86/kernel/unwind_frame.c:400 unwind_start arch/x86/include/asm/unwind.h:60 [inline] arch_stack_walk+0x5e/0xf0 arch/x86/kernel/stacktrace.c:24 stack_trace_save+0xac/0xe0 kernel/stacktrace.c:123 save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:488 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:523 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slab.c:3263 [inline] kmem_cache_alloc_node_trace+0x143/0x750 mm/slab.c:3593 __do_kmalloc_node mm/slab.c:3615 [inline] __kmalloc_node+0x3d/0x70 mm/slab.c:3623 kmalloc_node include/linux/slab.h:578 [inline] __vmalloc_area_node mm/vmalloc.c:2474 [inline] __vmalloc_node_range+0x1d0/0x790 mm/vmalloc.c:2554 alloc_thread_stack_node kernel/fork.c:243 [inline] dup_task_struct kernel/fork.c:872 [inline] copy_process+0x438e/0x7290 kernel/fork.c:1920 _do_fork+0x146/0x1090 kernel/fork.c:2430 __do_sys_clone kernel/fork.c:2585 [inline] __se_sys_clone kernel/fork.c:2566 [inline] __x64_sys_clone+0x19a/0x260 kernel/fork.c:2566 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x43fada Code: f7 d8 64 89 04 25 d4 02 00 00 64 4c 8b 0c 25 10 00 00 00 31 d2 4d 8d 91 d0 02 00 00 31 f6 bf 11 00 20 01 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 f5 00 00 00 85 c0 41 89 c5 0f 85 fc 00 00 RSP: 002b:00007ffe4021e540 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043fada RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 00007ffe4021e560 R08: 0000000000000000 R09: 00000000018c5880 R10: 00000000018c5b50 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000401fd0 R14: 0000000000000000 R15: 0000000000000000