BUG: sleeping function called from invalid context at net/core/sock.c:2502 in_atomic(): 1, irqs_disabled(): 0, pid: 28888, name: syz-executor5 1 lock held by syz-executor5/28888: #0: (rcu_callback){......}, at: [] __rcu_reclaim kernel/rcu/rcu.h:108 [inline] #0: (rcu_callback){......}, at: [] rcu_do_batch kernel/rcu/tree.c:2789 [inline] #0: (rcu_callback){......}, at: [] invoke_rcu_callbacks kernel/rcu/tree.c:3053 [inline] #0: (rcu_callback){......}, at: [] __rcu_process_callbacks kernel/rcu/tree.c:3020 [inline] #0: (rcu_callback){......}, at: [] rcu_process_callbacks+0x98e/0x12b0 kernel/rcu/tree.c:3037 Preemption disabled at:[ 346.575635] [] local_bh_disable include/linux/bottom_half.h:18 [inline] Preemption disabled at:[ 346.575635] [] pppol2tp_sendmsg+0x4a1/0x790 net/l2tp/l2tp_ppp.c:338 CPU: 1 PID: 28888 Comm: syz-executor5 Not tainted 4.9.124-g09eb2ba #31 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801db307d10 ffffffff81eb95e9 ffffffff836cf871 0000000000000000 0000000000000101 ffff8801b2efe000 ffff8801b2efe000 ffff8801db307d48 ffffffff81426851 ffff8801b2efe000 ffffffff840f88a0 00000000000009c6 Call Trace: [ 346.627597] [] __dump_stack lib/dump_stack.c:15 [inline] [ 346.627597] [] 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 [] do_softirq_own_stack+0x1c/0x30 arch/x86/entry/entry_64.S:843 [ 346.745593] [] do_softirq.part.14+0x62/0x70 kernel/softirq.c:332 [] do_softirq arch/x86/include/asm/preempt.h:22 [inline] [] __local_bh_enable_ip+0xc8/0xd0 kernel/softirq.c:185 [] local_bh_enable include/linux/bottom_half.h:31 [inline] [] pppol2tp_sendmsg+0x4f6/0x790 net/l2tp/l2tp_ppp.c:340 [] sock_sendmsg_nosec net/socket.c:648 [inline] [] sock_sendmsg+0xcc/0x110 net/socket.c:658 [] ___sys_sendmsg+0x47a/0x840 net/socket.c:1982 [] __sys_sendmmsg+0x161/0x3d0 net/socket.c:2072 [] SYSC_sendmmsg net/socket.c:2103 [inline] [] SyS_sendmmsg+0x35/0x60 net/socket.c:2098 [] 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-g09eb2ba #31 Tainted: G W --------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor5/28888 [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_release+0x50/0x2e0 net/l2tp/l2tp_ppp.c:476 __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 irq event stamp: 3858 hardirqs last enabled at (3858): [] restore_regs_and_iret+0x0/0x1d hardirqs last disabled at (3857): [] apic_timer_interrupt+0x9b/0xb0 arch/x86/entry/entry_64.S:648 softirqs last enabled at (3494): [] pppol2tp_sendmsg+0x4cf/0x790 net/l2tp/l2tp_ppp.c:339 softirqs last disabled at (3495): [] do_softirq_own_stack+0x1c/0x30 arch/x86/entry/entry_64.S:843 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(sk_lock-AF_PPPOX); lock(sk_lock-AF_PPPOX); *** DEADLOCK *** 1 lock held by syz-executor5/28888: #0: (rcu_callback){......}, at: [] __rcu_reclaim kernel/rcu/rcu.h:108 [inline] #0: (rcu_callback){......}, at: [] rcu_do_batch kernel/rcu/tree.c:2789 [inline] #0: (rcu_callback){......}, at: [] invoke_rcu_callbacks kernel/rcu/tree.c:3053 [inline] #0: (rcu_callback){......}, at: [] __rcu_process_callbacks kernel/rcu/tree.c:3020 [inline] #0: (rcu_callback){......}, at: [] rcu_process_callbacks+0x98e/0x12b0 kernel/rcu/tree.c:3037 stack backtrace: CPU: 1 PID: 28888 Comm: syz-executor5 Tainted: G W 4.9.124-g09eb2ba #31 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801db307a88 ffffffff81eb95e9 ffff8801b2efe000 ffffffff85613ac0 ffff8801b2efe8f0 ffff8801b2efe910 0000000000000000 ffff8801db307af8 ffffffff81429ccd 0000000000000003 0000000000000001 ffff880100000000 Call Trace: [ 347.150039] [] __dump_stack lib/dump_stack.c:15 [inline] [ 347.150039] [] 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 [] do_softirq_own_stack+0x1c/0x30 arch/x86/entry/entry_64.S:843 [ 347.327604] [] do_softirq.part.14+0x62/0x70 kernel/softirq.c:332 [] do_softirq arch/x86/include/asm/preempt.h:22 [inline] [] __local_bh_enable_ip+0xc8/0xd0 kernel/softirq.c:185 [] local_bh_enable include/linux/bottom_half.h:31 [inline] [] pppol2tp_sendmsg+0x4f6/0x790 net/l2tp/l2tp_ppp.c:340 [] sock_sendmsg_nosec net/socket.c:648 [inline] [] sock_sendmsg+0xcc/0x110 net/socket.c:658 [] ___sys_sendmsg+0x47a/0x840 net/socket.c:1982 [] __sys_sendmmsg+0x161/0x3d0 net/socket.c:2072 [] SYSC_sendmmsg net/socket.c:2103 [inline] [] SyS_sendmmsg+0x35/0x60 net/socket.c:2098 [] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb ================================================================== BUG: KASAN: use-after-free in l2tp_sock_to_tunnel net/l2tp/l2tp_core.h:234 [inline] BUG: KASAN: use-after-free in pppol2tp_sendmsg+0x681/0x790 net/l2tp/l2tp_ppp.c:304 Read of size 8 at addr ffff8801b6111750 by task syz-executor5/28888 CPU: 1 PID: 28888 Comm: syz-executor5 Tainted: G W 4.9.124-g09eb2ba #31 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801c10e78e0 ffffffff81eb95e9 ffffea0006d84400 ffff8801b6111750 0000000000000000 ffff8801b6111750 ffff8801b6111380 ffff8801c10e7918 ffffffff8156c35e ffff8801b6111750 0000000000000008 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_address_description+0x6c/0x234 mm/kasan/report.c:256 [] kasan_report_error mm/kasan/report.c:355 [inline] [] kasan_report.cold.6+0x242/0x2fe mm/kasan/report.c:412 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 [] l2tp_sock_to_tunnel net/l2tp/l2tp_core.h:234 [inline] [] pppol2tp_sendmsg+0x681/0x790 net/l2tp/l2tp_ppp.c:304 [] sock_sendmsg_nosec net/socket.c:648 [inline] [] sock_sendmsg+0xcc/0x110 net/socket.c:658 [] ___sys_sendmsg+0x47a/0x840 net/socket.c:1982 [] __sys_sendmmsg+0x161/0x3d0 net/socket.c:2072 [] SYSC_sendmmsg net/socket.c:2103 [inline] [] SyS_sendmmsg+0x35/0x60 net/socket.c:2098 [] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Allocated by task 28883: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:609 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:547 slab_post_alloc_hook mm/slab.h:417 [inline] slab_alloc_node mm/slub.c:2715 [inline] slab_alloc mm/slub.c:2723 [inline] kmem_cache_alloc+0xbe/0x290 mm/slub.c:2728 sk_prot_alloc+0x69/0x290 net/core/sock.c:1332 sk_alloc+0x3a/0x3a0 net/core/sock.c:1394 inet6_create+0x2d9/0xd80 net/ipv6/af_inet6.c:198 __sock_create+0x2f1/0x5f0 net/socket.c:1195 sock_create net/socket.c:1235 [inline] SYSC_socket net/socket.c:1265 [inline] SyS_socket+0xf0/0x1b0 net/socket.c:1245 do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x5d/0xdb Freed by task 28888: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:582 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kmem_cache_free+0xbe/0x310 mm/slub.c:2980 sk_prot_free net/core/sock.c:1375 [inline] __sk_destruct+0x3b9/0x590 net/core/sock.c:1455 __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 The buggy address belongs to the object at ffff8801b6111380 which belongs to the cache UDPv6 of size 1496 The buggy address is located 976 bytes inside of 1496-byte region [ffff8801b6111380, ffff8801b6111958) The buggy address belongs to the page: page:ffffea0006d84400 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x8000000000004080(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801b6111600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801b6111680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801b6111700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801b6111780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801b6111800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================