================================================================== BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x9a/0xc0 lib/usercopy.c:27 Read of size 337 at addr ffff8801ad8cfffd by task syz-executor3/11269 CPU: 1 PID: 11269 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:00007fcf3e073c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457569 RDX: 0000000000000028 RSI: 00000000200000c0 RDI: 000000000000000a RBP: 000000000072c040 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fcf3e0746d4 R13: 00000000004bd892 R14: 00000000004cc208 R15: 00000000ffffffff Allocated by task 10653: 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 kmem_cache_alloc_trace+0x138/0x300 mm/slub.c:2750 kmalloc include/linux/slab.h:488 [inline] audit_log_d_path+0x9f/0x170 kernel/audit.c:1973 dump_common_audit_data security/lsm_audit.c:251 [inline] common_lsm_audit+0x821/0x1d00 security/lsm_audit.c:459 slow_avc_audit+0x14a/0x1d0 security/selinux/avc.c:771 avc_audit security/selinux/include/avc.h:141 [inline] avc_has_perm+0x2f2/0x390 security/selinux/avc.c:1146 inode_has_perm.isra.21+0xff/0x160 security/selinux/hooks.c:1771 selinux_mmap_file+0x130/0x220 security/selinux/hooks.c:3621 security_mmap_file+0x93/0x170 security/security.c:926 vm_mmap_pgoff+0xdf/0x1d0 mm/util.c:329 vm_mmap+0x60/0x80 mm/util.c:352 elf_map+0x1c8/0x220 fs/binfmt_elf.c:373 load_elf_binary+0xbf8/0x4530 fs/binfmt_elf.c:990 search_binary_handler+0x13f/0x6c0 fs/exec.c:1638 exec_binprm fs/exec.c:1680 [inline] do_execveat_common.isra.14+0x1109/0x1d60 fs/exec.c:1802 do_execve fs/exec.c:1847 [inline] SYSC_execve fs/exec.c:1928 [inline] SyS_execve+0x34/0x40 fs/exec.c:1923 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 10653: 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] kfree+0xf5/0x310 mm/slub.c:3897 audit_log_d_path+0xf2/0x170 kernel/audit.c:1984 dump_common_audit_data security/lsm_audit.c:251 [inline] common_lsm_audit+0x821/0x1d00 security/lsm_audit.c:459 slow_avc_audit+0x14a/0x1d0 security/selinux/avc.c:771 avc_audit security/selinux/include/avc.h:141 [inline] avc_has_perm+0x2f2/0x390 security/selinux/avc.c:1146 inode_has_perm.isra.21+0xff/0x160 security/selinux/hooks.c:1771 selinux_mmap_file+0x130/0x220 security/selinux/hooks.c:3621 security_mmap_file+0x93/0x170 security/security.c:926 vm_mmap_pgoff+0xdf/0x1d0 mm/util.c:329 vm_mmap+0x60/0x80 mm/util.c:352 elf_map+0x1c8/0x220 fs/binfmt_elf.c:373 load_elf_binary+0xbf8/0x4530 fs/binfmt_elf.c:990 search_binary_handler+0x13f/0x6c0 fs/exec.c:1638 exec_binprm fs/exec.c:1680 [inline] do_execveat_common.isra.14+0x1109/0x1d60 fs/exec.c:1802 do_execve fs/exec.c:1847 [inline] SYSC_execve fs/exec.c:1928 [inline] SyS_execve+0x34/0x40 fs/exec.c:1923 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 ffff8801ad8cc200 which belongs to the cache kmalloc-8192 of size 8192 The buggy address is located 7677 bytes to the right of 8192-byte region [ffff8801ad8cc200, ffff8801ad8ce200) The buggy address belongs to the page: page:ffffea0006b63200 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000008100(slab|head) raw: 4000000000008100 0000000000000000 0000000000000000 0000000100030003 raw: ffffea0007491e00 0000000200000002 ffff8801da802400 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ad8cfe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801ad8cff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801ad8cff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8801ad8d0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801ad8d0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================