BUG: sleeping function called from invalid context at net/core/sock.c:2758 in_atomic(): 1, irqs_disabled(): 0, pid: 3018, name: syzkaller242216 1 lock held by syzkaller242216/3018: #0: (((&strp->msg_timer))){+.-.}, at: [] lockdep_copy_map include/linux/lockdep.h:183 [inline] #0: (((&strp->msg_timer))){+.-.}, at: [] call_timer_fn+0x1cd/0x830 kernel/time/timer.c:1271 CPU: 0 PID: 3018 Comm: syzkaller242216 Not tainted 4.14.0-rc5-next-20171018+ #8 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:52 ___might_sleep+0x2b2/0x470 kernel/sched/core.c:6047 __might_sleep+0x95/0x190 kernel/sched/core.c:6000 lock_sock_nested+0x37/0x110 net/core/sock.c:2758 lock_sock include/net/sock.h:1461 [inline] strp_sock_lock+0x2e/0x40 net/strparser/strparser.c:466 strp_msg_timeout+0x6c/0xf0 net/strparser/strparser.c:459 call_timer_fn+0x233/0x830 kernel/time/timer.c:1281 expire_timers kernel/time/timer.c:1320 [inline] __run_timers+0x7fd/0xb90 kernel/time/timer.c:1620 run_timer_softirq+0x4c/0xb0 kernel/time/timer.c:1646 __do_softirq+0x2d7/0xb85 kernel/softirq.c:284 invoke_softirq kernel/softirq.c:364 [inline] irq_exit+0x1cc/0x200 kernel/softirq.c:405 exiting_irq arch/x86/include/asm/apic.h:540 [inline] smp_apic_timer_interrupt+0x16b/0x700 arch/x86/kernel/apic/apic.c:1052 apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:577 RIP: 0010:arch_local_irq_enable arch/x86/include/asm/paravirt.h:787 [inline] RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] RIP: 0010:_raw_spin_unlock_irq+0x56/0x70 kernel/locking/spinlock.c:197 RSP: 0018:ffff88003e2577f8 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff11 RAX: dffffc0000000000 RBX: ffff88003ec256c0 RCX: 0000000000000000 RDX: 1ffffffff0b58f3b RSI: 0000000000000001 RDI: ffffffff85ac79d8 RBP: ffff88003e257800 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff88003c2f4200 R13: 1ffff10007c4af08 R14: ffff88003d4fa400 R15: ffff88003d4fa400 finish_lock_switch kernel/sched/sched.h:1349 [inline] finish_task_switch+0x1d3/0x740 kernel/sched/core.c:2665 context_switch kernel/sched/core.c:2801 [inline] __schedule+0x8f3/0x2060 kernel/sched/core.c:3374 schedule+0xf5/0x430 kernel/sched/core.c:3433 freezable_schedule include/linux/freezer.h:171 [inline] do_nanosleep+0x224/0x6e0 kernel/time/hrtimer.c:1473 hrtimer_nanosleep+0x2b2/0x860 kernel/time/hrtimer.c:1527 SYSC_nanosleep kernel/time/hrtimer.c:1559 [inline] SyS_nanosleep+0x175/0x1f0 kernel/time/hrtimer.c:1546 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x46c250 RSP: 002b:00000000007ef978 EFLAGS: 00000246 ORIG_RAX: 0000000000000023 RAX: ffffffffffffffda RBX: 000000000000051d RCX: 000000000046c250 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000007ef980 RBP: 0000000000000082 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000007ef950 R13: 000000000000051d R14: 00000000004091e0 R15: 0000000000000000 ================================ WARNING: inconsistent lock state 4.14.0-rc5-next-20171018+ #8 Tainted: G W -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syzkaller242216/3018 [HC0[0]:SC1[3]:HE1:SE0] takes: (sk_lock-AF_INET){+.?.}, at: [] lock_sock include/net/sock.h:1461 [inline] (sk_lock-AF_INET){+.?.}, at: [] strp_sock_lock+0x2e/0x40 net/strparser/strparser.c:466 {SOFTIRQ-ON-W} state was registered at: __trace_hardirqs_on_caller kernel/locking/lockdep.c:2879 [inline] trace_hardirqs_on_caller+0x421/0x5c0 kernel/locking/lockdep.c:2926 trace_hardirqs_on+0xd/0x10 kernel/locking/lockdep.c:2933 __local_bh_enable_ip+0x9d/0x160 kernel/softirq.c:186 local_bh_enable include/linux/bottom_half.h:31 [inline] lock_sock_nested+0xd9/0x110 net/core/sock.c:2768 lock_sock include/net/sock.h:1461 [inline] sock_setsockopt+0x163/0x1ad0 net/core/sock.c:715 SYSC_setsockopt net/socket.c:1847 [inline] SyS_setsockopt+0x2ff/0x360 net/socket.c:1830 entry_SYSCALL_64_fastpath+0x1f/0xbe irq event stamp: 195844 hardirqs last enabled at (195844): [] restore_regs_and_iret+0x0/0x1d hardirqs last disabled at (195843): [] apic_timer_interrupt+0x98/0xb0 arch/x86/entry/entry_64.S:577 softirqs last enabled at (195206): [] __do_softirq+0x7a0/0xb85 kernel/softirq.c:310 softirqs last disabled at (195775): [] invoke_softirq kernel/softirq.c:364 [inline] softirqs last disabled at (195775): [] irq_exit+0x1cc/0x200 kernel/softirq.c:405 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(sk_lock-AF_INET); lock(sk_lock-AF_INET); *** DEADLOCK *** 1 lock held by syzkaller242216/3018: #0: (((&strp->msg_timer))){+.-.}, at: [] lockdep_copy_map include/linux/lockdep.h:183 [inline] #0: (((&strp->msg_timer))){+.-.}, at: [] call_timer_fn+0x1cd/0x830 kernel/time/timer.c:1271 stack backtrace: CPU: 0 PID: 3018 Comm: syzkaller242216 Tainted: G W 4.14.0-rc5-next-20171018+ #8 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:52 print_usage_bug+0x40e/0x43e kernel/locking/lockdep.c:2585 valid_state kernel/locking/lockdep.c:2598 [inline] mark_lock_irq kernel/locking/lockdep.c:2792 [inline] mark_lock+0xe59/0x13d0 kernel/locking/lockdep.c:3190 mark_irqflags kernel/locking/lockdep.c:3068 [inline] __lock_acquire+0x1770/0x3d50 kernel/locking/lockdep.c:3444 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3991 lock_sock_nested+0xc2/0x110 net/core/sock.c:2767 lock_sock include/net/sock.h:1461 [inline] strp_sock_lock+0x2e/0x40 net/strparser/strparser.c:466 strp_msg_timeout+0x6c/0xf0 net/strparser/strparser.c:459 call_timer_fn+0x233/0x830 kernel/time/timer.c:1281 expire_timers kernel/time/timer.c:1320 [inline] __run_timers+0x7fd/0xb90 kernel/time/timer.c:1620 run_timer_softirq+0x4c/0xb0 kernel/time/timer.c:1646 __do_softirq+0x2d7/0xb85 kernel/softirq.c:284 invoke_softirq kernel/softirq.c:364 [inline] irq_exit+0x1cc/0x200 kernel/softirq.c:405 exiting_irq arch/x86/include/asm/apic.h:540 [inline] smp_apic_timer_interrupt+0x16b/0x700 arch/x86/kernel/apic/apic.c:1052 apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:577 RIP: 0010:arch_local_irq_enable arch/x86/include/asm/paravirt.h:787 [inline] RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] RIP: 0010:_raw_spin_unlock_irq+0x56/0x70 kernel/locking/spinlock.c:197 RSP: 0018:ffff88003e2577f8 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff11 RAX: dffffc0000000000 RBX: ffff88003ec256c0 RCX: 0000000000000000 RDX: 1ffffffff0b58f3b RSI: 0000000000000001 RDI: ffffffff85ac79d8 RBP: ffff88003e257800 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff88003c2f4200 R13: 1ffff10007c4af08 R14: ffff88003d4fa400 R15: ffff88003d4fa400 finish_lock_switch kernel/sched/sched.h:1349 [inline] finish_task_switch+0x1d3/0x740 kernel/sched/core.c:2665 context_switch kernel/sched/core.c:2801 [inline] __schedule+0x8f3/0x2060 kernel/sched/core.c:3374 schedule+0xf5/0x430 kernel/sched/core.c:3433 freezable_schedule include/linux/freezer.h:171 [inline] do_nanosleep+0x224/0x6e0 kernel/time/hrtimer.c:1473 hrtimer_nanosleep+0x2b2/0x860 kernel/time/hrtimer.c:1527 SYSC_nanosleep kernel/time/hrtimer.c:1559 [inline] SyS_nanosleep+0x175/0x1f0 kernel/time/hrtimer.c:1546 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x46c250 RSP: 002b:00000000007ef978 EFLAGS: 00000246 ORIG_RAX: 0000000000000023 RAX: ffffffffffffffda RBX: 000000000000051d RCX: 000000000046c250 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000007ef980 RBP: 0000000000000082 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000007ef950 R13: 000000000000051d R14: 00000000004091e0 R15: 0000000000000000