================================================================== BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x9a/0xc0 lib/usercopy.c:27 Read of size 1041 at addr ffff880187fffffc by task syz-executor3/26356 CPU: 0 PID: 26356 Comm: syz-executor3 Not tainted 4.14.76+ #19 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xb9/0x11b lib/dump_stack.c:53 print_address_description+0x60/0x22b mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409 _copy_to_user+0x9a/0xc0 lib/usercopy.c:27 copy_to_user include/linux/uaccess.h:155 [inline] bpf_test_finish.isra.0+0xc8/0x190 net/bpf/test_run.c:59 bpf_prog_test_run_skb+0x4d0/0x8c0 net/bpf/test_run.c:144 bpf_prog_test_run kernel/bpf/syscall.c:1330 [inline] SYSC_bpf kernel/bpf/syscall.c:1602 [inline] SyS_bpf+0x79d/0x3640 kernel/bpf/syscall.c:1547 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x457569 RSP: 002b:00007fee4516ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457569 RDX: 0000000000000028 RSI: 00000000200002c0 RDI: 000000000000000a RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fee4516f6d4 R13: 00000000004bd892 R14: 00000000004cc208 R15: 00000000ffffffff Allocated by task 347: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551 slab_post_alloc_hook mm/slab.h:442 [inline] slab_alloc_node mm/slub.c:2723 [inline] slab_alloc mm/slub.c:2731 [inline] kmem_cache_alloc+0xe4/0x2b0 mm/slub.c:2736 getname_flags+0xc4/0x540 fs/namei.c:138 user_path_at_empty+0x28/0x80 fs/namei.c:2611 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0xe1/0x180 fs/stat.c:185 vfs_lstat include/linux/fs.h:3091 [inline] SYSC_newlstat fs/stat.c:350 [inline] SyS_newlstat+0x81/0xf0 fs/stat.c:344 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 347: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524 slab_free_hook mm/slub.c:1389 [inline] slab_free_freelist_hook mm/slub.c:1410 [inline] slab_free mm/slub.c:2966 [inline] kmem_cache_free+0x12d/0x350 mm/slub.c:2988 putname+0xcf/0x100 fs/namei.c:259 filename_lookup.part.18+0x21e/0x370 fs/namei.c:2359 filename_lookup fs/namei.c:2343 [inline] user_path_at_empty+0x4b/0x80 fs/namei.c:2611 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0xe1/0x180 fs/stat.c:185 vfs_lstat include/linux/fs.h:3091 [inline] SYSC_newlstat fs/stat.c:350 [inline] SyS_newlstat+0x81/0xf0 fs/stat.c:344 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff880187ffe600 which belongs to the cache names_cache of size 4096 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=1 sclass=netlink_route_socket pig=26384 comm=syz-executor2 The buggy address is located 2556 bytes to the right of 4096-byte region [ffff880187ffe600, ffff880187fff600) The buggy address belongs to the page: SELinux: unrecognized netlink message: protocol=0 nlmsg_type=1 sclass=netlink_route_socket pig=26384 comm=syz-executor2 page:ffffea00061ffe00 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000008100(slab|head) raw: 4000000000008100 0000000000000000 0000000000000000 0000000100070007 raw: dead000000000100 dead000000000200 ffff8801da97e000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff880187fffe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff880187ffff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff880187ffff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff880188000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff880188000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ip6_tunnel: ip6tnl2 xmit: Local address not yet configured!