================================ WARNING: inconsistent lock state 4.15.0+ #285 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syzkaller956391/4160 [HC0[0]:SC1[1]:HE1:SE0] takes: (&(&est->lock)->rlock){+.?.}, at: [<00000000d190aa1e>] spin_lock include/linux/spinlock.h:310 [inline] (&(&est->lock)->rlock){+.?.}, at: [<00000000d190aa1e>] 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: 3085292 hardirqs last enabled at (3085292): [<000000000944f531>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] hardirqs last enabled at (3085292): [<000000000944f531>] _raw_spin_unlock_irq+0x27/0x70 kernel/locking/spinlock.c:192 hardirqs last disabled at (3085291): [<0000000019e812e2>] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (3085291): [<0000000019e812e2>] _raw_spin_lock_irq+0x3c/0x80 kernel/locking/spinlock.c:160 softirqs last enabled at (3085238): [<00000000ddae074b>] sock_orphan include/net/sock.h:1710 [inline] softirqs last enabled at (3085238): [<00000000ddae074b>] sk_common_release+0x166/0x2f0 net/core/sock.c:3013 softirqs last disabled at (3085289): [<000000006c7ebe83>] invoke_softirq kernel/softirq.c:365 [inline] softirqs last disabled at (3085289): [<000000006c7ebe83>] 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 syzkaller956391/4160: #0: (&mm->mmap_sem){++++}, at: [<00000000f3abfc25>] __do_page_fault+0x32d/0xc90 arch/x86/mm/fault.c:1355 #1: ((&est->timer)){+.-.}, at: [<000000008ab116d8>] lockdep_copy_map include/linux/lockdep.h:178 [inline] #1: ((&est->timer)){+.-.}, at: [<000000008ab116d8>] call_timer_fn+0x1c6/0x820 kernel/time/timer.c:1308 stack backtrace: CPU: 0 PID: 4160 Comm: syzkaller956391 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_save_flags arch/x86/include/asm/paravirt.h:772 [inline] RIP: 0010:arch_local_irq_save arch/x86/include/asm/paravirt.h:794 [inline] RIP: 0010:lock_is_held_type+0x69/0x210 kernel/locking/lockdep.c:3949 RSP: 0000:ffff8801b14f75f8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff11 RAX: dffffc0000000000 RBX: ffff8801b383e580 RCX: ffffffff819bcdf2 RDX: 0000000000000000 RSI: 00000000ffffffff RDI: ffffffff86ac8ca0 RBP: ffff8801b14f7618 R08: 000000000002f910 R09: 0000000000000000 R10: ffffffffffffffe8 R11: 0000000000000000 R12: 0000000000000000 R13: ffffffff86b41580 R14: 00000000000011e1 R15: 0000000000000058 lock_is_held include/linux/lockdep.h:344 [inline] ___might_sleep+0x39b/0x470 kernel/sched/core.c:6025 clear_huge_page+0xa5/0x730 mm/memory.c:4577 __do_huge_pmd_anonymous_page mm/huge_memory.c:570 [inline] do_huge_pmd_anonymous_page+0x59c/0x1b00 mm/huge_memory.c:728 create_huge_pmd mm/memory.c:3834 [inline] __handle_mm_fault+0x1a0c/0x3ce0 mm/memory.c:4038 handle_mm_fault+0x334/0x8d0 mm/memory.c:4104 __do_page_fault+0x5c9/0xc90 arch/x86/mm/fault.c:1426 do_page_fault+0xee/0x720 arch/x86/mm/fault.c:1501 page_fault+0x4c/0x60 arch/x86/entry/entry_64.S:1260 RIP: 0033:0x400e20 RSP: 002b:00000000007efe00 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 00000000004adcd0 RCX: 000000000044bdf9 RDX: 75ad179d85e272f0 RSI: 0000000000000000 RDI: 0000000002450848 RBP: 0000000000000068 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000217 R12: 0000000000000000 R13: 000000000000000a R14: 0000000000000000 R15: 0000000000000000