================================ WARNING: inconsistent lock state 5.5.0-rc6-next-20200116-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. blkid/21296 [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: 4278 hardirqs last enabled at (4278): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] hardirqs last enabled at (4278): [] _raw_spin_unlock_irq+0x23/0x80 kernel/locking/spinlock.c:199 hardirqs last disabled at (4277): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (4277): [] _raw_spin_lock_irq+0x3a/0x80 kernel/locking/spinlock.c:167 softirqs last enabled at (908): [] copy_init_fpstate_to_fpregs arch/x86/kernel/fpu/core.c:308 [inline] softirqs last enabled at (908): [] fpu__clear+0x17c/0x440 arch/x86/kernel/fpu/core.c:332 softirqs last disabled at (2059): [] invoke_softirq kernel/softirq.c:373 [inline] softirqs last disabled at (2059): [] 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 *** 3 locks held by blkid/21296: #0: ffff88809536f958 (&mm->mmap_sem#2){++++}, at: do_user_addr_fault arch/x86/mm/fault.c:1405 [inline] #0: ffff88809536f958 (&mm->mmap_sem#2){++++}, at: do_page_fault+0x34b/0x12e1 arch/x86/mm/fault.c:1539 #1: ffffffff89bb0400 (rcu_read_lock){....}, at: arch_static_branch arch/x86/include/asm/jump_label.h:25 [inline] #1: ffffffff89bb0400 (rcu_read_lock){....}, at: mem_cgroup_disabled include/linux/memcontrol.h:344 [inline] #1: ffffffff89bb0400 (rcu_read_lock){....}, at: count_memcg_event_mm include/linux/memcontrol.h:765 [inline] #1: ffffffff89bb0400 (rcu_read_lock){....}, at: handle_mm_fault+0xb7/0xa50 mm/memory.c:4144 #2: ffffc90000d98d50 ((&ima_key_queue_timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:172 [inline] #2: ffffc90000d98d50 ((&ima_key_queue_timer)){+.-.}, at: call_timer_fn+0xe0/0x780 kernel/time/timer.c:1394 stack backtrace: CPU: 1 PID: 21296 Comm: blkid 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:arch_local_irq_restore arch/x86/include/asm/paravirt.h:752 [inline] RIP: 0010:count_memcg_events include/linux/memcontrol.h:750 [inline] RIP: 0010:count_memcg_event_mm include/linux/memcontrol.h:771 [inline] RIP: 0010:handle_mm_fault+0x7d8/0xa50 mm/memory.c:4144 Code: fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 cf 01 00 00 48 83 3d d1 3d 0f 08 00 0f 84 36 01 00 00 e8 1e 1b d1 ff 48 8b 7d d0 57 9d <0f> 1f 44 00 00 e9 7a fa ff ff e8 09 1b d1 ff e8 64 a3 bd ff 31 ff RSP: 0000:ffffc90007db7e88 EFLAGS: 00000293 ORIG_RAX: ffffffffffffff13 RAX: ffff88807bed2640 RBX: 0000000000000200 RCX: 0000000000000007 RDX: 0000000000000000 RSI: ffffffff81a47cb2 RDI: 0000000000000293 RBP: ffffc90007db7ec8 R08: 1ffffffff16a51aa R09: fffffbfff16a51ab R10: fffffbfff16a51aa R11: ffffffff8b528d57 R12: ffff88808d94b880 R13: 0000000000000154 R14: 00007f87503b7db0 R15: ffff88808d94b8c0 do_user_addr_fault arch/x86/mm/fault.c:1464 [inline] do_page_fault+0x545/0x12e1 arch/x86/mm/fault.c:1539 page_fault+0x39/0x40 arch/x86/entry/entry_64.S:1203 RIP: 0033:0x7f87503b7db0 Code: Bad RIP value. RSP: 002b:00007ffd2f9fa548 EFLAGS: 00010202 RAX: 00007f87506adb70 RBX: 0000000000000005 RCX: 00007f8750afb040 RDX: 00007ffd2f9fa618 RSI: 00007ffd2f9fa5e8 RDI: 0000000000000005 RBP: 00007ffd2f9fa5e8 R08: 00000000000001ff R09: 0000000000000008 R10: 00007ffd2f9fa2f0 R11: 00007ffd2f9fa2f0 R12: 00007f87506aa748 R13: 00007ffd2f9fa618 R14: 0000000000000002 R15: 0000000000000002