================================================================== BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x9a/0xc0 lib/usercopy.c:27 Read of size 337 at addr ffff8801d0bb7ffd by task syz-executor2/6222 CPU: 1 PID: 6222 Comm: syz-executor2 Not tainted 4.14.74+ #17 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:0x457579 RSP: 002b:00007fee6ece7c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457579 RDX: 0000000000000028 RSI: 0000000020000180 RDI: 000000000000000a RBP: 000000000072c040 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fee6ece86d4 R13: 00000000004bd8a6 R14: 00000000004cc208 R15: 00000000ffffffff Allocated by task 2736: 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 getname fs/namei.c:209 [inline] user_path_create fs/namei.c:3713 [inline] SYSC_mkdirat fs/namei.c:3857 [inline] SyS_mkdirat+0x8d/0x220 fs/namei.c:3849 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 2736: 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_create+0x1f5/0x450 fs/namei.c:3678 user_path_create fs/namei.c:3713 [inline] SYSC_mkdirat fs/namei.c:3857 [inline] SyS_mkdirat+0x9f/0x220 fs/namei.c:3849 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 ffff8801d0bb6600 which belongs to the cache names_cache of size 4096 The buggy address is located 2557 bytes to the right of 4096-byte region [ffff8801d0bb6600, ffff8801d0bb7600) The buggy address belongs to the page: page:ffffea000742ec00 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: ffff8801d0bb7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801d0bb7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801d0bb7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8801d0bb8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801d0bb8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== kauditd_printk_skb: 139 callbacks suppressed audit: type=1400 audit(2000000907.350:72278): avc: denied { map } for pid=6250 comm="modprobe" path="/etc/ld.so.cache" dev="sda1" ino=2503 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(2000000907.410:72279): avc: denied { map } for pid=6250 comm="modprobe" path="/lib/x86_64-linux-gnu/libkmod.so.2.1.3" dev="sda1" ino=2811 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(2000000907.420:72280): avc: denied { map } for pid=6231 comm="getty" path="/lib/x86_64-linux-gnu/libnss_files-2.13.so" dev="sda1" ino=2714 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(2000000907.430:72281): avc: denied { map } for pid=6250 comm="modprobe" path="/lib/x86_64-linux-gnu/libkmod.so.2.1.3" dev="sda1" ino=2811 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(2000000907.440:72282): avc: denied { map } for pid=6231 comm="getty" path="/lib/x86_64-linux-gnu/libnss_files-2.13.so" dev="sda1" ino=2714 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(2000000907.470:72283): avc: denied { map } for pid=6250 comm="modprobe" path="/lib/x86_64-linux-gnu/libc-2.13.so" dev="sda1" ino=2784 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(2000000907.500:72284): avc: denied { map } for pid=6231 comm="getty" path="/etc/group" dev="sda1" ino=2218 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(2000000907.500:72285): avc: denied { map } for pid=6250 comm="modprobe" path="/lib/x86_64-linux-gnu/libc-2.13.so" dev="sda1" ino=2784 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(2000000907.740:72286): avc: denied { map } for pid=6258 comm="modprobe" path="/bin/kmod" dev="sda1" ino=1440 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1