================================ WARNING: inconsistent lock state 4.15.0+ #285 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syzkaller808642/4159 [HC0[0]:SC1[1]:HE1:SE0] takes: (&(&est->lock)->rlock){+.?.}, at: [<000000004449056c>] spin_lock include/linux/spinlock.h:310 [inline] (&(&est->lock)->rlock){+.?.}, at: [<000000004449056c>] est_fetch_counters+0x4f/0x150 net/core/gen_estimator.c:70 {SOFTIRQ-ON-W} state was registered at: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3915 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:310 [inline] est_fetch_counters+0x4f/0x150 net/core/gen_estimator.c:70 gen_new_estimator+0x317/0x770 net/core/gen_estimator.c:162 xt_rateest_tg_checkentry+0x487/0xaa0 net/netfilter/xt_RATEEST.c:135 xt_check_target+0x22c/0x7d0 net/netfilter/x_tables.c:845 check_target net/ipv6/netfilter/ip6_tables.c:538 [inline] find_check_entry.isra.7+0x935/0xcf0 net/ipv6/netfilter/ip6_tables.c:580 translate_table+0xf52/0x1690 net/ipv6/netfilter/ip6_tables.c:749 do_replace net/ipv6/netfilter/ip6_tables.c:1167 [inline] do_ip6t_set_ctl+0x370/0x5f0 net/ipv6/netfilter/ip6_tables.c:1693 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x115/0x150 net/ipv6/ipv6_sockglue.c:928 udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1452 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2968 SYSC_setsockopt net/socket.c:1831 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1810 entry_SYSCALL_64_fastpath+0x29/0xa0 irq event stamp: 1572878 hardirqs last enabled at (1572878): [<00000000f7e198fc>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] hardirqs last enabled at (1572878): [<00000000f7e198fc>] _raw_spin_unlock_irq+0x27/0x70 kernel/locking/spinlock.c:192 hardirqs last disabled at (1572877): [<00000000257b44a8>] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (1572877): [<00000000257b44a8>] _raw_spin_lock_irq+0x3c/0x80 kernel/locking/spinlock.c:160 softirqs last enabled at (1572532): [<000000000a8b56e5>] sock_orphan include/net/sock.h:1710 [inline] softirqs last enabled at (1572532): [<000000000a8b56e5>] sk_common_release+0x166/0x2f0 net/core/sock.c:3013 softirqs last disabled at (1572875): [<0000000036372419>] invoke_softirq kernel/softirq.c:365 [inline] softirqs last disabled at (1572875): [<0000000036372419>] irq_exit+0x1cc/0x200 kernel/softirq.c:405 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&(&est->lock)->rlock); lock(&(&est->lock)->rlock); *** DEADLOCK *** 2 locks held by syzkaller808642/4159: #0: (&mm->mmap_sem){++++}, at: [<00000000cd952ef3>] vm_mmap_pgoff+0x198/0x280 mm/util.c:331 #1: ((&est->timer)){+.-.}, at: [<000000007550d21f>] lockdep_copy_map include/linux/lockdep.h:178 [inline] #1: ((&est->timer)){+.-.}, at: [<000000007550d21f>] call_timer_fn+0x1c6/0x820 kernel/time/timer.c:1308 stack backtrace: CPU: 0 PID: 4159 Comm: syzkaller808642 Not tainted 4.15.0+ #285 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_usage_bug+0x377/0x38c kernel/locking/lockdep.c:2538 valid_state kernel/locking/lockdep.c:2551 [inline] mark_lock_irq kernel/locking/lockdep.c:2745 [inline] mark_lock+0xf61/0x1430 kernel/locking/lockdep.c:3143 mark_irqflags kernel/locking/lockdep.c:3021 [inline] __lock_acquire+0x173a/0x3e00 kernel/locking/lockdep.c:3384 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3915 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:310 [inline] est_fetch_counters+0x4f/0x150 net/core/gen_estimator.c:70 est_timer+0x97/0x7c0 net/core/gen_estimator.c:85 call_timer_fn+0x228/0x820 kernel/time/timer.c:1318 expire_timers kernel/time/timer.c:1355 [inline] __run_timers+0x7ee/0xb70 kernel/time/timer.c:1658 run_timer_softirq+0x4c/0x70 kernel/time/timer.c:1684 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 invoke_softirq kernel/softirq.c:365 [inline] irq_exit+0x1cc/0x200 kernel/softirq.c:405 exiting_irq arch/x86/include/asm/apic.h:541 [inline] smp_apic_timer_interrupt+0x16b/0x700 arch/x86/kernel/apic/apic.c:1052 apic_timer_interrupt+0xa9/0xb0 arch/x86/entry/entry_64.S:937 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:777 [inline] RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x5e/0xba kernel/locking/spinlock.c:184 RSP: 0018:ffff8801d309e5b8 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff11 RAX: dffffc0000000000 RBX: 0000000000000282 RCX: 0000000000000006 RDX: 1ffffffff0d59195 RSI: 1ffff10035e645f3 RDI: 0000000000000282 RBP: ffff8801d309e5c8 R08: 1ffff1003a613c85 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff88257528 R13: ffff8801d309e780 R14: 0000000000000000 R15: dffffc0000000000 __debug_check_no_obj_freed lib/debugobjects.c:758 [inline] debug_check_no_obj_freed+0x3da/0xf1f lib/debugobjects.c:774 free_pages_prepare mm/page_alloc.c:1065 [inline] __free_pages_ok+0x765/0x31e0 mm/page_alloc.c:1259 free_compound_page+0x5e/0x70 mm/page_alloc.c:601 free_transhuge_page+0x2d2/0x430 mm/huge_memory.c:2740 __put_compound_page+0x87/0xb0 mm/swap.c:95 release_pages+0x64b/0x1230 mm/swap.c:788 free_pages_and_swap_cache+0x2ad/0x400 mm/swap_state.c:322 tlb_flush_mmu_free+0xb4/0x160 mm/memory.c:260 tlb_flush_mmu mm/memory.c:269 [inline] arch_tlb_finish_mmu+0x9d/0x130 mm/memory.c:284 tlb_finish_mmu+0x10f/0x190 mm/memory.c:427 unmap_region+0x35c/0x4f0 mm/mmap.c:2514 do_munmap+0x726/0xdf0 mm/mmap.c:2726 mmap_region+0x59e/0x15a0 mm/mmap.c:1646 do_mmap+0x6c0/0xe00 mm/mmap.c:1483 do_mmap_pgoff include/linux/mm.h:2217 [inline] vm_mmap_pgoff+0x1de/0x280 mm/util.c:333 SYSC_mmap_pgoff mm/mmap.c:1533 [inline] SyS_mmap_pgoff+0x23b/0x5f0 mm/mmap.c:1491 SYSC_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:91 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x441049 RSP: 002b:00007ffd2b8d36e8 EFLAGS: 00000212 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: ffffffffffffffff RCX: 0000000000441049 RDX: 0000000000000003 RSI: 0000000000fff000 RDI: 0000000020000000 RBP: 31affa775212f497 R08: 00000000ffffffff R09: 0000000000000000 R10: 0000000000000032 R11: 0000000000000212 R12: f3023f5f5df3bc21 R13: f6fcce9cd855ec40 R14: fbfe5b6031634428 R15: 0000000000000000