================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:344 [inline] BUG: KASAN: slab-out-of-bounds in map_lookup_elem+0x4dc/0xbd0 kernel/bpf/syscall.c:584 Read of size 3 at addr ffff8801d6c53278 by task syz-executor6/17421 CPU: 1 PID: 17421 Comm: syz-executor6 Not tainted 4.15.0-rc7+ #262 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x137/0x190 mm/kasan/kasan.c:267 memcpy+0x23/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:344 [inline] map_lookup_elem+0x4dc/0xbd0 kernel/bpf/syscall.c:584 SYSC_bpf kernel/bpf/syscall.c:1711 [inline] SyS_bpf+0x922/0x4400 kernel/bpf/syscall.c:1685 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x452cf9 RSP: 002b:00007fae0801bc58 EFLAGS: 00000212 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000452cf9 RDX: 0000000000000018 RSI: 00000000206d1fe8 RDI: 0000000000000001 RBP: 0000000000000037 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006ee5c8 R13: 00000000ffffffff R14: 00007fae0801c6d4 R15: 0000000000000000 Allocated by task 16820: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 __do_kmalloc mm/slab.c:3708 [inline] __kmalloc+0x162/0x760 mm/slab.c:3717 kmalloc include/linux/slab.h:504 [inline] kzalloc include/linux/slab.h:688 [inline] __proc_create+0x21a/0x880 fs/proc/generic.c:366 proc_create_data+0x76/0x180 fs/proc/generic.c:488 proc_create+0x2f/0x40 fs/proc/generic.c:508 raw_init_net+0x4a/0x70 net/ipv4/raw.c:1131 ops_init+0x10a/0x570 net/core/net_namespace.c:118 setup_net+0x313/0x710 net/core/net_namespace.c:295 copy_net_ns+0x27c/0x580 net/core/net_namespace.c:419 create_new_namespaces+0x425/0x880 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xae/0x1e0 kernel/nsproxy.c:206 SYSC_unshare kernel/fork.c:2365 [inline] SyS_unshare+0x653/0xfa0 kernel/fork.c:2315 entry_SYSCALL_64_fastpath+0x29/0xa0 Freed by task 6688: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3488 [inline] kfree+0xd6/0x260 mm/slab.c:3803 free_proc_entry fs/proc/generic.c:531 [inline] pde_put+0x9a/0xf0 fs/proc/generic.c:537 remove_proc_entry+0x1e3/0x360 fs/proc/generic.c:573 ip6mr_net_exit+0x40/0x90 net/ipv6/ip6mr.c:1392 ops_exit_list.isra.6+0xae/0x150 net/core/net_namespace.c:142 cleanup_net+0x5c7/0xb50 net/core/net_namespace.c:484 process_one_work+0xbbf/0x1b10 kernel/workqueue.c:2112 worker_thread+0x223/0x1990 kernel/workqueue.c:2246 kthread+0x33c/0x400 kernel/kthread.c:238 ret_from_fork+0x37/0x50 arch/x86/entry/entry_64.S:530 The buggy address belongs to the object at ffff8801d6c53180 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 248 bytes inside of 256-byte region [ffff8801d6c53180, ffff8801d6c53280) The buggy address belongs to the page: page:ffffea00075b14c0 count:1 mapcount:0 mapping:ffff8801d6c53040 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801d6c53040 0000000000000000 000000010000000c raw: ffffea0007411960 ffffea00074b0ce0 ffff8801dac007c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d6c53100: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff8801d6c53180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8801d6c53200: 00 00 00 00 00 00 00 00 00 04 fc fc fc fc fc fc ^ ffff8801d6c53280: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8801d6c53300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================