BUG: sleeping function called from invalid context at net/core/sock.c:2502 in_atomic(): 1, irqs_disabled(): 0, pid: 2370, name: udevd 1 lock held by udevd/2370: #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:[ 132.410153] [] __do_softirq+0xdd/0x940 kernel/softirq.c:265 CPU: 1 PID: 2370 Comm: udevd Not tainted 4.9.124-g6a1b592 #82 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801db307cd8 ffffffff81eb95e9 ffffffff83a0848d 0000000000000000 0000000000000100 ffff8801bada3000 ffff8801bada3000 ffff8801db307d10 ffffffff81426851 ffff8801bada3000 ffffffff840f88a0 00000000000009c6 Call Trace: [ 132.460546] [] __dump_stack lib/dump_stack.c:15 [inline] [ 132.460546] [] 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 [ 132.590410] [] ? arch_local_irq_restore arch/x86/include/asm/paravirt.h:768 [inline] [ 132.590410] [] ? __call_rcu.constprop.69+0x2c2/0x910 kernel/rcu/tree.c:3196 [] call_rcu+0x12/0x20 kernel/rcu/tree_plugin.h:655 [] dentry_free+0xb7/0x150 fs/dcache.c:343 [] __dentry_kill+0x33f/0x4c0 fs/dcache.c:583 [] dentry_kill fs/dcache.c:610 [inline] [] dput.part.29+0x500/0x7b0 fs/dcache.c:827 [] dput+0x1f/0x30 fs/dcache.c:789 [] path_put fs/namei.c:516 [inline] [] terminate_walk+0x27b/0x560 fs/namei.c:630 [] path_lookupat.isra.41+0x1cb/0x410 fs/namei.c:2301 [] filename_lookup.part.55+0x177/0x370 fs/namei.c:2317 [] filename_lookup fs/namei.c:2310 [inline] [] user_path_at_empty+0x53/0x70 fs/namei.c:2578 [] user_path_at include/linux/namei.h:55 [inline] [] vfs_fstatat+0xc6/0x170 fs/stat.c:106 [] vfs_stat fs/stat.c:123 [inline] [] SYSC_newstat+0x86/0xf0 fs/stat.c:270 [] SyS_newstat+0x1d/0x30 fs/stat.c:266 [] 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 #82 Tainted: G W --------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. udevd/2370 [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] pppolac_release+0x52/0x400 drivers/net/ppp/pppolac.c:346 __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: 1455910 hardirqs last enabled at (1455910): [] restore_regs_and_iret+0x0/0x1d hardirqs last disabled at (1455909): [] apic_timer_interrupt+0x9b/0xb0 arch/x86/entry/entry_64.S:648 softirqs last enabled at (1451576): [] __do_softirq+0x475/0x940 kernel/softirq.c:314 softirqs last disabled at (1455825): [] invoke_softirq kernel/softirq.c:368 [inline] softirqs last disabled at (1455825): [] 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 *** 1 lock held by udevd/2370: #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: 2370 Comm: udevd Tainted: G W 4.9.124-g6a1b592 #82 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801db307a58 ffffffff81eb95e9 ffff8801bada3000 ffffffff85610ee0 ffff8801bada38f0 ffff8801bada3910 0000000000000000 ffff8801db307ac8 ffffffff81429ccd 0000000000000003 0000000000000001 ffff880100000000 Call Trace: [ 133.015390] [] __dump_stack lib/dump_stack.c:15 [inline] [ 133.015390] [] 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 [ 133.186652] [] ? arch_local_irq_restore arch/x86/include/asm/paravirt.h:768 [inline] [ 133.186652] [] ? __call_rcu.constprop.69+0x2c2/0x910 kernel/rcu/tree.c:3196 [] call_rcu+0x12/0x20 kernel/rcu/tree_plugin.h:655 [] dentry_free+0xb7/0x150 fs/dcache.c:343 [] __dentry_kill+0x33f/0x4c0 fs/dcache.c:583 [] dentry_kill fs/dcache.c:610 [inline] [] dput.part.29+0x500/0x7b0 fs/dcache.c:827 [] dput+0x1f/0x30 fs/dcache.c:789 [] path_put fs/namei.c:516 [inline] [] terminate_walk+0x27b/0x560 fs/namei.c:630 [] path_lookupat.isra.41+0x1cb/0x410 fs/namei.c:2301 [] filename_lookup.part.55+0x177/0x370 fs/namei.c:2317 [] filename_lookup fs/namei.c:2310 [inline] [] user_path_at_empty+0x53/0x70 fs/namei.c:2578 [] user_path_at include/linux/namei.h:55 [inline] [] vfs_fstatat+0xc6/0x170 fs/stat.c:106 [] vfs_stat fs/stat.c:123 [inline] [] SYSC_newstat+0x86/0xf0 fs/stat.c:270 [] SyS_newstat+0x1d/0x30 fs/stat.c:266 [] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb ================================================================== BUG: KASAN: use-after-free in inet_shutdown+0x2dc/0x360 net/ipv4/af_inet.c:824 Read of size 4 at addr ffff8801cbc61980 by task udevd/2370 CPU: 1 PID: 2370 Comm: udevd Tainted: G W 4.9.124-g6a1b592 #82 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801db307cf8 ffffffff81eb95e9 ffffea00072f1800 ffff8801cbc61980 0000000000000000 ffff8801cbc61980 ffff8801a51bef58 ffff8801db307d30 ffffffff8156c35e ffff8801cbc61980 0000000000000004 0000000000000000 Call Trace: [ 133.438870] [] __dump_stack lib/dump_stack.c:15 [inline] [ 133.438870] [] 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_load4_noabort+0x14/0x20 mm/kasan/report.c:432 [] inet_shutdown+0x2dc/0x360 net/ipv4/af_inet.c:824 [] 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 [ 133.563667] [] ? arch_local_irq_restore arch/x86/include/asm/paravirt.h:768 [inline] [ 133.563667] [] ? __call_rcu.constprop.69+0x2c2/0x910 kernel/rcu/tree.c:3196 [] call_rcu+0x12/0x20 kernel/rcu/tree_plugin.h:655 [] dentry_free+0xb7/0x150 fs/dcache.c:343 [] __dentry_kill+0x33f/0x4c0 fs/dcache.c:583 [] dentry_kill fs/dcache.c:610 [inline] [] dput.part.29+0x500/0x7b0 fs/dcache.c:827 [] dput+0x1f/0x30 fs/dcache.c:789 [] path_put fs/namei.c:516 [inline] [] terminate_walk+0x27b/0x560 fs/namei.c:630 [] path_lookupat.isra.41+0x1cb/0x410 fs/namei.c:2301 [] filename_lookup.part.55+0x177/0x370 fs/namei.c:2317 [] filename_lookup fs/namei.c:2310 [inline] [] user_path_at_empty+0x53/0x70 fs/namei.c:2578 [] user_path_at include/linux/namei.h:55 [inline] [] vfs_fstatat+0xc6/0x170 fs/stat.c:106 [] vfs_stat fs/stat.c:123 [inline] [] SYSC_newstat+0x86/0xf0 fs/stat.c:270 [] SyS_newstat+0x1d/0x30 fs/stat.c:266 [] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Allocated by task 11627: 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 sock_alloc_inode+0x1d/0x260 net/socket.c:251 alloc_inode+0x63/0x180 fs/inode.c:207 new_inode_pseudo+0x17/0xe0 fs/inode.c:890 sock_alloc+0x41/0x280 net/socket.c:571 __sock_create+0x8d/0x5f0 net/socket.c:1159 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 11626: 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 sock_destroy_inode+0x56/0x70 net/socket.c:281 destroy_inode+0xc5/0x120 fs/inode.c:264 evict+0x32b/0x4f0 fs/inode.c:570 iput_final fs/inode.c:1516 [inline] iput+0x371/0x900 fs/inode.c:1543 dentry_unlink_inode+0x277/0x330 fs/dcache.c:367 __dentry_kill+0x280/0x4c0 fs/dcache.c:569 dentry_kill fs/dcache.c:610 [inline] dput.part.29+0x5cf/0x7b0 fs/dcache.c:827 dput+0x1f/0x30 fs/dcache.c:789 __fput+0x42f/0x700 fs/file_table.c:226 ____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 The buggy address belongs to the object at ffff8801cbc61980 which belongs to the cache sock_inode_cache of size 960 The buggy address is located 0 bytes inside of 960-byte region [ffff8801cbc61980, ffff8801cbc61d40) The buggy address belongs to the page: page:ffffea00072f1800 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: ffff8801cbc61880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801cbc61900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801cbc61980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801cbc61a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801cbc61a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================