================================================================== BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x9a/0xc0 lib/usercopy.c:27 Read of size 337 at addr ffff8801a0ac7ffd by task syz-executor5/16715 CPU: 0 PID: 16715 Comm: syz-executor5 Not tainted 4.14.78+ #28 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 audit: type=1326 audit(2000000262.006:93481): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=16728 comm="syz-executor2" exe="/root/syz-executor2" sig=9 arch=c000003e syscall=228 compat=0 ip=0x45a3ca code=0x0 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:00007fe37ab74c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457569 RDX: 0000000000000028 RSI: 0000000020000080 RDI: 000000000000000a RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe37ab756d4 R13: 00000000004bd892 R14: 00000000004cc488 R15: 00000000ffffffff Allocated by task 26216: 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 kmem_cache_alloc_node include/linux/slab.h:361 [inline] alloc_task_struct_node kernel/fork.c:157 [inline] dup_task_struct kernel/fork.c:523 [inline] copy_process.part.6+0x1435/0x6530 kernel/fork.c:1598 copy_process kernel/fork.c:1573 [inline] _do_fork+0x1c2/0xd50 kernel/fork.c:2054 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 17: 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 __put_task_struct+0x26f/0x460 kernel/fork.c:428 put_task_struct include/linux/sched/task.h:96 [inline] delayed_put_task_struct+0x95/0x2e0 kernel/exit.c:180 __rcu_reclaim kernel/rcu/rcu.h:195 [inline] rcu_do_batch kernel/rcu/tree.c:2691 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2945 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2912 [inline] rcu_process_callbacks+0x54d/0xee0 kernel/rcu/tree.c:2929 __do_softirq+0x215/0x997 kernel/softirq.c:288 The buggy address belongs to the object at ffff8801a0ac5e00 which belongs to the cache task_struct of size 5760 The buggy address is located 2941 bytes to the right of 5760-byte region [ffff8801a0ac5e00, ffff8801a0ac7480) The buggy address belongs to the page: page:ffffea000682b000 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000008100(slab|head) raw: 4000000000008100 0000000000000000 0000000000000000 0000000100050005 raw: ffffea00073ac200 0000000300000003 ffff8801da823e00 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801a0ac7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801a0ac7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801a0ac7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8801a0ac8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801a0ac8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================