================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline] BUG: KASAN: use-after-free in atomic_read arch/x86/include/asm/atomic.h:27 [inline] BUG: KASAN: use-after-free in refcount_inc_not_zero+0xd3/0xe0 lib/refcount.c:120 Read of size 4 at addr ffff888067d23580 by task kworker/u4:0/5 CPU: 1 PID: 5 Comm: kworker/u4:0 Not tainted 4.14.141 #37 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: l2tp l2tp_tunnel_del_work Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x138/0x197 lib/dump_stack.c:53 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429 __read_once_size include/linux/compiler.h:183 [inline] atomic_read arch/x86/include/asm/atomic.h:27 [inline] refcount_inc_not_zero+0xd3/0xe0 lib/refcount.c:120 refcount_inc+0x16/0x40 lib/refcount.c:153 sock_hold include/net/sock.h:619 [inline] pppol2tp_session_sock_hold+0x48/0x60 net/l2tp/l2tp_ppp.c:263 l2tp_tunnel_closeall+0x1ef/0x380 net/l2tp/l2tp_core.c:1332 l2tp_tunnel_del_work+0x64/0x410 net/l2tp/l2tp_core.c:1380 process_one_work+0x863/0x1600 kernel/workqueue.c:2114 worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248 kthread+0x319/0x430 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Allocated by task 3527: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc mm/kasan/kasan.c:551 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x780 mm/slab.c:3552 getname_flags fs/namei.c:138 [inline] getname_flags+0xcb/0x580 fs/namei.c:128 user_path_at_empty+0x2f/0x50 fs/namei.c:2630 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0xcd/0x160 fs/stat.c:185 vfs_stat include/linux/fs.h:3060 [inline] SYSC_newstat+0x95/0x100 fs/stat.c:337 SyS_newstat+0x1e/0x30 fs/stat.c:333 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 3527: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kmem_cache_free+0x83/0x2b0 mm/slab.c:3758 putname+0xdb/0x120 fs/namei.c:259 filename_lookup+0x23a/0x380 fs/namei.c:2385 user_path_at_empty+0x43/0x50 fs/namei.c:2630 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0xcd/0x160 fs/stat.c:185 vfs_stat include/linux/fs.h:3060 [inline] SYSC_newstat+0x95/0x100 fs/stat.c:337 SyS_newstat+0x1e/0x30 fs/stat.c:333 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff888067d22e80 which belongs to the cache names_cache of size 4096 The buggy address is located 1792 bytes inside of 4096-byte region [ffff888067d22e80, ffff888067d23e80) The buggy address belongs to the page: page:ffffea00019f4880 count:1 mapcount:0 mapping:ffff888067d22e80 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffff888067d22e80 0000000000000000 0000000100000001 raw: ffffea00022ea120 ffffea00019af6a0 ffff8880aa9e0cc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888067d23480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888067d23500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888067d23580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb kobject: 'loop3' (ffff8880a4afc160): fill_kobj_path: path = '/devices/virtual/block/loop3' ^ ffff888067d23600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888067d23680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================