================================ WARNING: inconsistent lock state 5.5.0-rc6-next-20200114-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.4/12981 [HC0[0]:SC1[1]:HE1:SE0] takes: ffffffff8a03aa18 (ima_keys_lock){+.?.}, at: spin_lock include/linux/spinlock.h:338 [inline] ffffffff8a03aa18 (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:940 do_initcall_level init/main.c:1014 [inline] do_initcalls init/main.c:1022 [inline] do_basic_setup init/main.c:1039 [inline] kernel_init_freeable+0x4ca/0x570 init/main.c:1223 kernel_init+0x12/0x1bf init/main.c:1130 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 irq event stamp: 2424 hardirqs last enabled at (2424): [] trace_hardirqs_on_thunk+0x1a/0x1c arch/x86/entry/thunk_64.S:41 hardirqs last disabled at (2423): [] trace_hardirqs_off_thunk+0x1a/0x1c arch/x86/entry/thunk_64.S:42 softirqs last enabled at (1010): [] __do_softirq+0x6cd/0x98c kernel/softirq.c:319 softirqs last disabled at (2365): [] invoke_softirq kernel/softirq.c:373 [inline] softirqs last disabled at (2365): [] 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 syz-executor.4/12981: #0: ffff88809186d648 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline] #0: ffff88809186d648 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pte_range mm/memory.c:1038 [inline] #0: ffff88809186d648 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pmd_range mm/memory.c:1184 [inline] #0: ffff88809186d648 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pud_range mm/memory.c:1213 [inline] #0: ffff88809186d648 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_p4d_range mm/memory.c:1234 [inline] #0: ffff88809186d648 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: unmap_page_range+0x87a/0x2810 mm/memory.c:1255 #1: ffffffff89baf700 (rcu_read_lock){....}, at: lock_page_memcg+0x0/0x240 mm/memcontrol.c:6870 #2: ffffc90000007d50 ((&ima_key_queue_timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:172 [inline] #2: ffffc90000007d50 ((&ima_key_queue_timer)){+.-.}, at: call_timer_fn+0xe0/0x780 kernel/time/timer.c:1394 stack backtrace: CPU: 0 PID: 12981 Comm: syz-executor.4 Not tainted 5.5.0-rc6-next-20200114-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:lock_acquire+0x20b/0x410 kernel/locking/lockdep.c:4487 Code: 9c 08 00 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 0f 85 d3 01 00 00 48 83 3d b9 9f 58 08 00 0f 84 53 01 00 00 48 8b 7d c8 57 9d <0f> 1f 44 00 00 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 65 8b RSP: 0018:ffffc90006ce7648 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff13675f3 RBX: ffff8880993ac200 RCX: ffffffff815ab4f0 RDX: dffffc0000000000 RSI: 0000000000000008 RDI: 0000000000000286 RBP: ffffc90006ce7690 R08: 1ffffffff16a3ba4 R09: fffffbfff16a3ba5 R10: ffff8880993acac8 R11: ffff8880993ac200 R12: ffffffff89baf700 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000002 rcu_lock_acquire include/linux/rcupdate.h:208 [inline] rcu_read_lock include/linux/rcupdate.h:601 [inline] lock_page_memcg+0x39/0x240 mm/memcontrol.c:1972 page_remove_file_rmap mm/rmap.c:1237 [inline] page_remove_rmap+0x5ce/0x11d0 mm/rmap.c:1330 zap_pte_range mm/memory.c:1080 [inline] zap_pmd_range mm/memory.c:1184 [inline] zap_pud_range mm/memory.c:1213 [inline] zap_p4d_range mm/memory.c:1234 [inline] unmap_page_range+0xdd5/0x2810 mm/memory.c:1255 unmap_single_vma+0x19d/0x300 mm/memory.c:1300 unmap_vmas+0x184/0x2f0 mm/memory.c:1332 exit_mmap+0x2ba/0x530 mm/mmap.c:3145 __mmput kernel/fork.c:1082 [inline] mmput+0x179/0x4d0 kernel/fork.c:1103 exit_mm kernel/exit.c:485 [inline] do_exit+0xae4/0x2f70 kernel/exit.c:788 do_group_exit+0x135/0x360 kernel/exit.c:899 get_signal+0x47c/0x24f0 kernel/signal.c:2734 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:813 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath arch/x86/entry/common.c:278 [inline] do_syscall_64+0x676/0x790 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45af49 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f8fb55c2cf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000001 RBX: 000000000075bf28 RCX: 000000000045af49 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 000000000075bf2c RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000018 R11: 0000000000000246 R12: 000000000075bf2c R13: 00007ffd5b828b1f R14: 00007f8fb55c39c0 R15: 000000000075bf2c