================================ WARNING: inconsistent lock state 5.5.0-rc6-next-20200116-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.2/11503 [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: 2418 hardirqs last enabled at (2418): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] hardirqs last enabled at (2418): [] _raw_spin_unlock_irq+0x23/0x80 kernel/locking/spinlock.c:199 hardirqs last disabled at (2417): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (2417): [] _raw_spin_lock_irq+0x3a/0x80 kernel/locking/spinlock.c:167 softirqs last enabled at (802): [] __do_softirq+0x6cd/0x98c kernel/softirq.c:319 softirqs last disabled at (2415): [] invoke_softirq kernel/softirq.c:373 [inline] softirqs last disabled at (2415): [] 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.2/11503: #0: ffff88809578db70 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline] #0: ffff88809578db70 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pte_range mm/memory.c:1038 [inline] #0: ffff88809578db70 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pmd_range mm/memory.c:1184 [inline] #0: ffff88809578db70 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pud_range mm/memory.c:1213 [inline] #0: ffff88809578db70 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_p4d_range mm/memory.c:1234 [inline] #0: ffff88809578db70 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: unmap_page_range+0x87a/0x2810 mm/memory.c:1255 #1: ffffffff89bb0400 (rcu_read_lock){....}, at: lock_page_memcg+0x0/0x240 mm/memcontrol.c:6870 #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: 11503 Comm: syz-executor.2 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:debug_lockdep_rcu_enabled.part.0+0x2a/0x60 kernel/rcu/update.c:264 Code: 48 b8 00 00 00 00 00 fc ff df 55 48 89 e5 53 65 48 8b 1c 25 c0 1e 02 00 48 8d bb 9c 08 00 00 48 89 fa 48 c1 ea 03 0f b6 14 02 <48> 89 f8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 10 8b 93 9c 08 00 RSP: 0018:ffffc900056778d0 EFLAGS: 00000a07 ORIG_RAX: ffffffffffffff13 RAX: dffffc0000000000 RBX: ffff8880a049a480 RCX: 1ffffffff154ac06 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8880a049ad1c RBP: ffffc900056778d8 R08: 1ffffffff16a51a4 R09: fffffbfff16a51a5 R10: ffff8880a049ad48 R11: ffff8880a049a480 R12: ffffea00018a6980 R13: 0000000000000000 R14: ffffea00018a6988 R15: dead000000000100 debug_lockdep_rcu_enabled+0x71/0xa0 kernel/rcu/update.c:263 rcu_read_lock include/linux/rcupdate.h:602 [inline] lock_page_memcg+0x3e/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/0x2f80 kernel/exit.c:788 do_group_exit+0x135/0x360 kernel/exit.c:899 __do_sys_exit_group kernel/exit.c:910 [inline] __se_sys_exit_group kernel/exit.c:908 [inline] __x64_sys_exit_group+0x44/0x50 kernel/exit.c:908 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45b399 Code: Bad RIP value. RSP: 002b:00007ffd49a81a98 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 000000000000001e RCX: 000000000045b399 RDX: 0000000000414f10 RSI: 00000000000003e4 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000004 R09: 00007ffd49a81af0 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffd49a81af0 R14: 0000000000000000 R15: 00007ffd49a81b00