================================ WARNING: inconsistent lock state 5.5.0-rc6-next-20200116-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.0/13120 [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: 3478 hardirqs last enabled at (3478): [] trace_hardirqs_on_thunk+0x1a/0x1c arch/x86/entry/thunk_64.S:41 hardirqs last disabled at (3477): [] trace_hardirqs_off_thunk+0x1a/0x1c arch/x86/entry/thunk_64.S:42 softirqs last enabled at (3442): [] memcpy include/linux/string.h:426 [inline] softirqs last enabled at (3442): [] fpu__copy+0x17e/0x8c0 arch/x86/kernel/fpu/core.c:195 softirqs last disabled at (3473): [] invoke_softirq kernel/softirq.c:373 [inline] softirqs last disabled at (3473): [] 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 *** 2 locks held by syz-executor.0/13120: #0: ffffffff89bd4810 (cgroup_threadgroup_rwsem.rw_sem){++++}, at: _do_fork+0x146/0x1090 kernel/fork.c:2430 #1: ffffc90000007d50 ((&ima_key_queue_timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:172 [inline] #1: ffffc90000007d50 ((&ima_key_queue_timer)){+.-.}, at: call_timer_fn+0xe0/0x780 kernel/time/timer.c:1394 stack backtrace: CPU: 0 PID: 13120 Comm: syz-executor.0 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:cgroup_post_fork+0x2ab/0x7a0 kernel/cgroup/cgroup.c:5968 Code: 48 89 fa 48 c1 ea 03 42 80 3c 2a 00 0f 85 88 04 00 00 4e 8b 3c fd a0 46 bd 89 49 8d 7f 70 48 89 fa 48 c1 ea 03 42 80 3c 2a 00 <0f> 85 60 04 00 00 4c 89 e7 41 ff 57 70 8d 53 01 be 0d 00 00 00 4c RSP: 0018:ffffc90000da7ac0 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: ffff8880511ac3c0 RBX: 0000000000000000 RCX: ffffffff816f67b1 RDX: 1ffffffff137ba4e RSI: ffffffff816f67c6 RDI: ffffffff89bdd270 RBP: ffffc90000da7b58 R08: ffff8880511ac3c0 R09: fffffbfff16a51a7 R10: fffffbfff16a51a6 R11: ffffffff8b528d37 R12: ffff88809b3b0480 R13: dffffc0000000000 R14: ffffc90000da7af0 R15: ffffffff89bdd200 copy_process+0x421b/0x7290 kernel/fork.c:2291 _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:0x45dd69 Code: ff 48 85 f6 0f 84 d7 8c fb ff 48 83 ee 10 48 89 4e 08 48 89 3e 48 89 d7 4c 89 c2 4d 89 c8 4c 8b 54 24 08 b8 38 00 00 00 0f 05 <48> 85 c0 0f 8c ae 8c fb ff 74 01 c3 31 ed 48 f7 c7 00 00 01 00 75 RSP: 002b:00007ffc98992428 EFLAGS: 00000202 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007f9b5c6bd700 RCX: 000000000045dd69 RDX: 00007f9b5c6bd9d0 RSI: 00007f9b5c6bcdb0 RDI: 00000000003d0f00 RBP: 00007ffc98992640 R08: 00007f9b5c6bd700 R09: 00007f9b5c6bd700 R10: 00007f9b5c6bd9d0 R11: 0000000000000202 R12: 0000000000000000 R13: 00007ffc989924df R14: 00007f9b5c6bd9c0 R15: 000000000075bf2c