================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:404 [inline] BUG: KASAN: slab-out-of-bounds in bpf_prog_create+0xe9/0x250 net/core/filter.c:1351 Read of size 64 at addr ffff8880a9929d40 by task syz-executor.4/9351 CPU: 0 PID: 9351 Comm: syz-executor.4 Not tainted 5.3.0-rc8-next-20190915 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:634 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192 memcpy+0x24/0x50 mm/kasan/common.c:122 memcpy include/linux/string.h:404 [inline] bpf_prog_create+0xe9/0x250 net/core/filter.c:1351 get_filter.isra.0+0x108/0x1a0 drivers/net/ppp/ppp_generic.c:572 ppp_get_filter drivers/net/ppp/ppp_generic.c:584 [inline] ppp_ioctl+0x129d/0x2590 drivers/net/ppp/ppp_generic.c:801 vfs_ioctl fs/ioctl.c:47 [inline] file_ioctl fs/ioctl.c:539 [inline] do_vfs_ioctl+0xdb6/0x13e0 fs/ioctl.c:726 ksys_ioctl+0xab/0xd0 fs/ioctl.c:743 __do_sys_ioctl fs/ioctl.c:750 [inline] __se_sys_ioctl fs/ioctl.c:748 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:748 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4598e9 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f1bcec8ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004598e9 RDX: 0000000020000040 RSI: 0000000040107447 RDI: 0000000000000004 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1bcec8b6d4 R13: 00000000004c3579 R14: 00000000004d6e40 R15: 00000000ffffffff Allocated by task 9351: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:483 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:524 __do_kmalloc mm/slab.c:3655 [inline] __kmalloc_track_caller+0x15f/0x760 mm/slab.c:3670 memdup_user+0x26/0xb0 mm/util.c:172 get_filter.isra.0+0xd7/0x1a0 drivers/net/ppp/ppp_generic.c:568 ppp_get_filter drivers/net/ppp/ppp_generic.c:584 [inline] ppp_ioctl+0x129d/0x2590 drivers/net/ppp/ppp_generic.c:801 vfs_ioctl fs/ioctl.c:47 [inline] file_ioctl fs/ioctl.c:539 [inline] do_vfs_ioctl+0xdb6/0x13e0 fs/ioctl.c:726 ksys_ioctl+0xab/0xd0 fs/ioctl.c:743 __do_sys_ioctl fs/ioctl.c:750 [inline] __se_sys_ioctl fs/ioctl.c:748 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:748 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:471 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480 __cache_free mm/slab.c:3425 [inline] kfree+0x10a/0x2c0 mm/slab.c:3756 kvfree+0x61/0x70 mm/util.c:593 kvfree_rcu+0x16/0x20 mm/list_lru.c:398 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2157 [inline] rcu_core+0x581/0x1560 kernel/rcu/tree.c:2377 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386 __do_softirq+0x262/0x98c kernel/softirq.c:292 The buggy address belongs to the object at ffff8880a9929d40 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8880a9929d40, ffff8880a9929d60) The buggy address belongs to the page: page:ffffea0002a64a40 refcount:1 mapcount:0 mapping:ffff8880aa4001c0 index:0xffff8880a9929fc1 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002775b88 ffffea00026bb8c8 ffff8880aa4001c0 raw: ffff8880a9929fc1 ffff8880a9929000 000000010000003f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a9929c00: 05 fc fc fc fc fc fc fc 00 01 fc fc fc fc fc fc ffff8880a9929c80: 00 fc fc fc fc fc fc fc fb fb fb fb fc fc fc fc >ffff8880a9929d00: fb fb fb fb fc fc fc fc 00 fc fc fc fc fc fc fc ^ ffff8880a9929d80: 05 fc fc fc fc fc fc fc 05 fc fc fc fc fc fc fc ffff8880a9929e00: 00 00 00 fc fc fc fc fc 00 fc fc fc fc fc fc fc ==================================================================