================================ WARNING: inconsistent lock state 5.5.0-rc6-next-20200116-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.5/11407 [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: 240 hardirqs last enabled at (240): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] hardirqs last enabled at (240): [] _raw_spin_unlock_irq+0x23/0x80 kernel/locking/spinlock.c:199 hardirqs last disabled at (239): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (239): [] _raw_spin_lock_irq+0x3a/0x80 kernel/locking/spinlock.c:167 softirqs last enabled at (132): [] lock_sock_nested+0x9a/0x120 net/core/sock.c:2939 softirqs last disabled at (237): [] invoke_softirq kernel/softirq.c:373 [inline] softirqs last disabled at (237): [] 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 *** 4 locks held by syz-executor.5/11407: #0: ffff888094e68150 (sk_lock-AF_INET){+.+.}, at: lock_sock include/net/sock.h:1516 [inline] #0: ffff888094e68150 (sk_lock-AF_INET){+.+.}, at: sock_setsockopt+0x163/0x22d0 net/core/sock.c:745 #1: ffffffff89c557a0 (vmap_purge_lock){+.+.}, at: _vm_unmap_aliases mm/vmalloc.c:1744 [inline] #1: ffffffff89c557a0 (vmap_purge_lock){+.+.}, at: _vm_unmap_aliases+0x386/0x480 mm/vmalloc.c:1711 #2: ffffffff89c55938 (free_vmap_area_lock){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline] #2: ffffffff89c55938 (free_vmap_area_lock){+.+.}, at: __purge_vmap_area_lazy+0x194/0x1ef0 mm/vmalloc.c:1314 #3: ffffc90000007d50 ((&ima_key_queue_timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:172 [inline] #3: ffffc90000007d50 ((&ima_key_queue_timer)){+.-.}, at: call_timer_fn+0xe0/0x780 kernel/time/timer.c:1394 stack backtrace: CPU: 0 PID: 11407 Comm: syz-executor.5 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:lock_is_held_type+0x272/0x320 kernel/locking/lockdep.c:4523 Code: ff df c7 83 9c 08 00 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 0f 85 88 00 00 00 48 83 3d ae 23 59 08 00 74 31 48 8b 7d c0 57 9d <0f> 1f 44 00 00 48 83 c4 20 44 89 e0 5b 41 5c 41 5d 41 5e 41 5f 5d RSP: 0018:ffffc900015e7598 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff136774f RBX: ffff888061018340 RCX: ffff888061018be0 RDX: dffffc0000000000 RSI: ffffffff89bb0380 RDI: 0000000000000286 RBP: ffffc900015e75e0 R08: ffff888061018340 R09: ffffed1015d07074 R10: ffffed1015d07073 R11: ffff8880ae83839b R12: 0000000000000000 R13: ffff888061018c30 R14: ffffffff89bb0380 R15: 0000000000000003 lock_is_held include/linux/lockdep.h:361 [inline] rcu_read_lock_sched_held+0x9c/0xd0 kernel/rcu/update.c:121 trace_kmem_cache_free include/trace/events/kmem.h:145 [inline] kmem_cache_free+0x26b/0x320 mm/slab.c:3697 merge_or_add_vmap_area mm/vmalloc.c:733 [inline] __purge_vmap_area_lazy+0xf3b/0x1ef0 mm/vmalloc.c:1325 _vm_unmap_aliases mm/vmalloc.c:1746 [inline] _vm_unmap_aliases+0x396/0x480 mm/vmalloc.c:1711 vm_unmap_aliases+0x19/0x20 mm/vmalloc.c:1769 change_page_attr_set_clr+0x22e/0x840 arch/x86/mm/pat/set_memory.c:1709 change_page_attr_clear arch/x86/mm/pat/set_memory.c:1766 [inline] set_memory_ro+0x7b/0xa0 arch/x86/mm/pat/set_memory.c:1899 bpf_jit_binary_lock_ro include/linux/filter.h:797 [inline] bpf_int_jit_compile+0xebd/0x12ce arch/x86/net/bpf_jit_comp.c:1807 bpf_prog_select_runtime+0x4b9/0x850 kernel/bpf/core.c:1799 bpf_migrate_filter net/core/filter.c:1275 [inline] bpf_prepare_filter net/core/filter.c:1323 [inline] bpf_prepare_filter+0x977/0xd60 net/core/filter.c:1289 __get_filter+0x212/0x2c0 net/core/filter.c:1492 sk_attach_filter+0x1e/0xa0 net/core/filter.c:1507 sock_setsockopt+0x1f66/0x22d0 net/core/sock.c:999 __sys_setsockopt+0x440/0x4c0 net/socket.c:2126 __do_sys_setsockopt net/socket.c:2146 [inline] __se_sys_setsockopt net/socket.c:2143 [inline] __x64_sys_setsockopt+0xbe/0x150 net/socket.c:2143 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45b399 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:00007f4cafb26c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f4cafb276d4 RCX: 000000000045b399 RDX: 000000000000001a RSI: 0000000000000001 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000010 R09: 0000000000000000 R10: 0000000020000480 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000a20 R14: 00000000004cb828 R15: 000000000075bf2c