BUG: sleeping function called from invalid context at net/core/sock.c:2502 in_atomic(): 1, irqs_disabled(): 0, pid: 3879, name: syz-executor2 5 locks held by syz-executor2/3879: #0: (sb_writers#3){.+.+.+}, at: [] sb_start_write include/linux/fs.h:1573 [inline] #0: (sb_writers#3){.+.+.+}, at: [] mnt_want_write+0x3f/0xb0 fs/namespace.c:391 #1: (sb_internal){.+.+..}, at: [] sb_start_intwrite include/linux/fs.h:1620 [inline] #1: (sb_internal){.+.+..}, at: [] ext4_evict_inode+0x345/0x1240 fs/ext4/inode.c:240 #2: (jbd2_handle){++++..}, at: [] start_this_handle+0x443/0xe40 fs/jbd2/transaction.c:387 #3: (&(&bgl->locks[i].lock)->rlock){+.+...}, at: [] spin_trylock include/linux/spinlock.h:312 [inline] #3: (&(&bgl->locks[i].lock)->rlock){+.+...}, at: [] ext4_lock_group fs/ext4/ext4.h:2896 [inline] #3: (&(&bgl->locks[i].lock)->rlock){+.+...}, at: [] ext4_free_inode+0x77f/0x1360 fs/ext4/ialloc.c:313 #4: (rcu_callback){......}, at: [] __rcu_reclaim kernel/rcu/rcu.h:108 [inline] #4: (rcu_callback){......}, at: [] rcu_do_batch kernel/rcu/tree.c:2789 [inline] #4: (rcu_callback){......}, at: [] invoke_rcu_callbacks kernel/rcu/tree.c:3053 [inline] #4: (rcu_callback){......}, at: [] __rcu_process_callbacks kernel/rcu/tree.c:3020 [inline] #4: (rcu_callback){......}, at: [] rcu_process_callbacks+0x98e/0x12b0 kernel/rcu/tree.c:3037 Preemption disabled at:[ 189.916998] [] spin_trylock include/linux/spinlock.h:312 [inline] Preemption disabled at:[ 189.916998] [] ext4_lock_group fs/ext4/ext4.h:2896 [inline] Preemption disabled at:[ 189.916998] [] ext4_free_inode+0x77f/0x1360 fs/ext4/ialloc.c:313 CPU: 0 PID: 3879 Comm: syz-executor2 Not tainted 4.9.124-g6a1b592 #30 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801db207cd8 ffffffff81eb95e9 ffffffff81737f5f 0000000000000000 0000000000000101 ffff8801b84fc800 ffff8801b84fc800 ffff8801db207d10 ffffffff81426851 ffff8801b84fc800 ffffffff840f88a0 00000000000009c6 Call Trace: [ 189.968560] [] __dump_stack lib/dump_stack.c:15 [inline] [ 189.968560] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] ___might_sleep.cold.123+0x1bc/0x1f5 kernel/sched/core.c:7988 [] __might_sleep+0x95/0x1a0 kernel/sched/core.c:7945 [] lock_sock_nested+0x34/0x120 net/core/sock.c:2502 [] lock_sock include/net/sock.h:1404 [inline] [] inet_shutdown+0x69/0x360 net/ipv4/af_inet.c:823 [] pppol2tp_session_close+0xa0/0xe0 net/l2tp/l2tp_ppp.c:441 [] l2tp_tunnel_closeall+0x231/0x350 net/l2tp/l2tp_core.c:1368 [] l2tp_tunnel_destruct+0x2f2/0x590 net/l2tp/l2tp_core.c:1324 [] __sk_destruct+0x55/0x590 net/core/sock.c:1428 [] __rcu_reclaim kernel/rcu/rcu.h:118 [inline] [] rcu_do_batch kernel/rcu/tree.c:2789 [inline] [] invoke_rcu_callbacks kernel/rcu/tree.c:3053 [inline] [] __rcu_process_callbacks kernel/rcu/tree.c:3020 [inline] [] rcu_process_callbacks+0x8ae/0x12b0 kernel/rcu/tree.c:3037 [] __do_softirq+0x210/0x940 kernel/softirq.c:288 [] invoke_softirq kernel/softirq.c:368 [inline] [] irq_exit+0x114/0x150 kernel/softirq.c:409 [] exiting_irq arch/x86/include/asm/apic.h:669 [inline] [] smp_apic_timer_interrupt+0x81/0xa0 arch/x86/kernel/apic/apic.c:962 [] apic_timer_interrupt+0xa0/0xb0 arch/x86/entry/entry_64.S:648 [ 190.098947] [] ? ext4_inode_bitmap_csum_set+0x85/0x4e0 fs/ext4/bitmap.c:45 [] ext4_free_inode+0x935/0x1360 fs/ext4/ialloc.c:327 [] ext4_evict_inode+0xc4e/0x1240 fs/ext4/inode.c:310 [] evict+0x22e/0x4f0 fs/inode.c:553 [] iput_final fs/inode.c:1516 [inline] [] iput+0x371/0x900 fs/inode.c:1543 [] do_unlinkat+0x4f8/0x680 fs/namei.c:4087 [] SYSC_unlink fs/namei.c:4128 [inline] [] SyS_unlink+0x1a/0x20 fs/namei.c:4126 [] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb ================================= [ INFO: inconsistent lock state ] 4.9.124-g6a1b592 #30 Tainted: G W --------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor2/3879 [HC0[0]:SC1[3]:HE1:SE0] takes: (sk_lock-AF_PPPOX){+.?.+.}, at: [] lock_sock include/net/sock.h:1404 [inline] (sk_lock-AF_PPPOX){+.?.+.}, at: [] inet_shutdown+0x69/0x360 net/ipv4/af_inet.c:823 mark_held_locks+0xc7/0x130 kernel/locking/lockdep.c:2660 __trace_hardirqs_on_caller kernel/locking/lockdep.c:2689 [inline] trace_hardirqs_on_caller+0x38b/0x590 kernel/locking/lockdep.c:2736 trace_hardirqs_on+0xd/0x10 kernel/locking/lockdep.c:2743 __local_bh_enable_ip+0x6a/0xd0 kernel/softirq.c:190 local_bh_enable include/linux/bottom_half.h:31 [inline] lock_sock_nested+0xdc/0x120 net/core/sock.c:2512 lock_sock include/net/sock.h:1404 [inline] pppol2tp_connect+0xd9/0x18f0 net/l2tp/l2tp_ppp.c:590 SYSC_connect+0x1b8/0x300 net/socket.c:1575 SyS_connect+0x24/0x30 net/socket.c:1556 do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x5d/0xdb irq event stamp: 1044732 hardirqs last enabled at (1044732): [] restore_regs_and_iret+0x0/0x1d hardirqs last disabled at (1044731): [] apic_timer_interrupt+0x9b/0xb0 arch/x86/entry/entry_64.S:648 softirqs last enabled at (1042746): [] __do_softirq+0x475/0x940 kernel/softirq.c:314 softirqs last disabled at (1043711): [] invoke_softirq kernel/softirq.c:368 [inline] softirqs last disabled at (1043711): [] irq_exit+0x114/0x150 kernel/softirq.c:409 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(sk_lock-AF_PPPOX); lock(sk_lock-AF_PPPOX); *** DEADLOCK *** 5 locks held by syz-executor2/3879: #0: (sb_writers#3){.+.+.+}, at: [] sb_start_write include/linux/fs.h:1573 [inline] #0: (sb_writers#3){.+.+.+}, at: [] mnt_want_write+0x3f/0xb0 fs/namespace.c:391 #1: (sb_internal){.+.+..}, at: [] sb_start_intwrite include/linux/fs.h:1620 [inline] #1: (sb_internal){.+.+..}, at: [] ext4_evict_inode+0x345/0x1240 fs/ext4/inode.c:240 #2: (jbd2_handle){++++..}, at: [] start_this_handle+0x443/0xe40 fs/jbd2/transaction.c:387 #3: (&(&bgl->locks[i].lock)->rlock){+.+...}, at: [] spin_trylock include/linux/spinlock.h:312 [inline] #3: (&(&bgl->locks[i].lock)->rlock){+.+...}, at: [] ext4_lock_group fs/ext4/ext4.h:2896 [inline] #3: (&(&bgl->locks[i].lock)->rlock){+.+...}, at: [] ext4_free_inode+0x77f/0x1360 fs/ext4/ialloc.c:313 #4: (rcu_callback){......}, at: [] __rcu_reclaim kernel/rcu/rcu.h:108 [inline] #4: (rcu_callback){......}, at: [] rcu_do_batch kernel/rcu/tree.c:2789 [inline] #4: (rcu_callback){......}, at: [] invoke_rcu_callbacks kernel/rcu/tree.c:3053 [inline] #4: (rcu_callback){......}, at: [] __rcu_process_callbacks kernel/rcu/tree.c:3020 [inline] #4: (rcu_callback){......}, at: [] rcu_process_callbacks+0x98e/0x12b0 kernel/rcu/tree.c:3037 stack backtrace: CPU: 0 PID: 3879 Comm: syz-executor2 Tainted: G W 4.9.124-g6a1b592 #30 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801db207a58 ffffffff81eb95e9 ffff8801b84fc800 ffffffff85601d90 ffff8801b84fd190 ffff8801b84fd1b0 0000000000000000 ffff8801db207ac8 ffffffff81429ccd 0000000000000003 0000000000000001 ffff880100000000 Call Trace: [ 190.498135] [] __dump_stack lib/dump_stack.c:15 [inline] [ 190.498135] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_usage_bug.cold.57+0x327/0x421 kernel/locking/lockdep.c:2387 [] valid_state kernel/locking/lockdep.c:2400 [inline] [] mark_lock_irq kernel/locking/lockdep.c:2602 [inline] [] mark_lock+0xcc6/0x1280 kernel/locking/lockdep.c:3065 [] mark_irqflags kernel/locking/lockdep.c:2923 [inline] [] __lock_acquire+0xd40/0x4070 kernel/locking/lockdep.c:3302 [] lock_acquire+0x130/0x3e0 kernel/locking/lockdep.c:3756 [] lock_sock_nested+0xc6/0x120 net/core/sock.c:2511 [] lock_sock include/net/sock.h:1404 [inline] [] inet_shutdown+0x69/0x360 net/ipv4/af_inet.c:823 [] pppol2tp_session_close+0xa0/0xe0 net/l2tp/l2tp_ppp.c:441 [] l2tp_tunnel_closeall+0x231/0x350 net/l2tp/l2tp_core.c:1368 [] l2tp_tunnel_destruct+0x2f2/0x590 net/l2tp/l2tp_core.c:1324 [] __sk_destruct+0x55/0x590 net/core/sock.c:1428 [] __rcu_reclaim kernel/rcu/rcu.h:118 [inline] [] rcu_do_batch kernel/rcu/tree.c:2789 [inline] [] invoke_rcu_callbacks kernel/rcu/tree.c:3053 [inline] [] __rcu_process_callbacks kernel/rcu/tree.c:3020 [inline] [] rcu_process_callbacks+0x8ae/0x12b0 kernel/rcu/tree.c:3037 [] __do_softirq+0x210/0x940 kernel/softirq.c:288 [] invoke_softirq kernel/softirq.c:368 [inline] [] irq_exit+0x114/0x150 kernel/softirq.c:409 [] exiting_irq arch/x86/include/asm/apic.h:669 [inline] [] smp_apic_timer_interrupt+0x81/0xa0 arch/x86/kernel/apic/apic.c:962 [] apic_timer_interrupt+0xa0/0xb0 arch/x86/entry/entry_64.S:648 [ 190.669559] [] ? ext4_inode_bitmap_csum_set+0x85/0x4e0 fs/ext4/bitmap.c:45 [] ext4_free_inode+0x935/0x1360 fs/ext4/ialloc.c:327 [] ext4_evict_inode+0xc4e/0x1240 fs/ext4/inode.c:310 [] evict+0x22e/0x4f0 fs/inode.c:553 [] iput_final fs/inode.c:1516 [inline] [] iput+0x371/0x900 fs/inode.c:1543 [] do_unlinkat+0x4f8/0x680 fs/namei.c:4087 [] SYSC_unlink fs/namei.c:4128 [inline] [] SyS_unlink+0x1a/0x20 fs/namei.c:4126 [] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb BUG: unable to handle kernel NULL pointer dereference at 0000000000000080 IP: [] l2tp_session_free+0x11c/0x200 net/l2tp/l2tp_core.c:1765 PGD 196ed8067 [ 190.840309] PUD 1ca4bb067 Oops: 0002 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 1 PID: 12480 Comm: syz-executor0 Tainted: G W 4.9.124-g6a1b592 #30 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff880196299800 task.stack: ffff88019bb98000 RIP: 0010:[] [] l2tp_session_free+0x11c/0x200 net/l2tp/l2tp_core.c:1765 RSP: 0018:ffff88019bb9fc98 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffff8801d4247400 RCX: 0000000000000000 RDX: 1ffff1003b2945c0 RSI: ffffffff836c4711 RDI: ffff8801d94a2e00 RBP: ffff88019bb9fcb8 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801d94a2c80 R13: ffff8801d4247408 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000001bc5940(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000080 CR3: 00000001d3dc9000 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffff88019c44d500 ffff8801d4247400 ffff88019c44d8d0 ffff88019c44d7d8 ffff88019bb9fce0 ffffffff836cc022 ffff88019c44d940 ffff88019c44d500 ffffffff836cbf50 ffff88019bb9fd18 ffffffff830281f5 ffff88019c44d940 Call Trace: [] l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:297 [inline] [] pppol2tp_session_destruct+0xd2/0x110 net/l2tp/l2tp_ppp.c:460 [] __sk_destruct+0x55/0x590 net/core/sock.c:1428 [] sk_destruct+0x63/0x80 net/core/sock.c:1463 [] __sk_free+0x4f/0x220 net/core/sock.c:1471 [] sk_free+0x2b/0x40 net/core/sock.c:1482 [] sock_put include/net/sock.h:1588 [inline] [] pppol2tp_release+0x239/0x2e0 net/l2tp/l2tp_ppp.c:501 [] __sock_release+0xd7/0x260 net/socket.c:605 [] sock_close+0x19/0x20 net/socket.c:1059 [] __fput+0x263/0x700 fs/file_table.c:208 [] ____fput+0x15/0x20 fs/file_table.c:244 [] task_work_run+0x10c/0x180 kernel/task_work.c:116 [] tracehook_notify_resume include/linux/tracehook.h:191 [inline] [] exit_to_usermode_loop+0xfc/0x120 arch/x86/entry/common.c:161 [] prepare_exit_to_usermode arch/x86/entry/common.c:191 [inline] [] syscall_return_slowpath arch/x86/entry/common.c:260 [inline] [] do_syscall_64+0x364/0x490 arch/x86/entry/common.c:287 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Code: 49 8d bc 24 80 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 c6 00 00 00 4d 8b b4 24 80 01 00 00 41 ff 8e 80 00 00 00 74 69 e8 a5 c5 c9 fd 4c 89 ea 48 b8 00 RIP [] l2tp_session_free+0x11c/0x200 net/l2tp/l2tp_core.c:1765 RSP CR2: 0000000000000080 ---[ end trace 86eb7c07a1de7f4b ]---