================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:359 [inline] BUG: KASAN: slab-out-of-bounds in bpf_prog_create+0xca/0x1f0 net/core/filter.c:1351 Read of size 32768 at addr ffff88809403e1c0 by task syz-executor.2/8864 CPU: 0 PID: 8864 Comm: syz-executor.2 Not tainted 5.3.0-rc6+ #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+0x113/0x167 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x318 mm/kasan/report.c:351 __kasan_report.cold.9+0x1b/0x3f mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:618 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x153/0x1d0 mm/kasan/generic.c:192 memcpy+0x23/0x50 mm/kasan/common.c:122 memcpy include/linux/string.h:359 [inline] bpf_prog_create+0xca/0x1f0 net/core/filter.c:1351 get_filter.isra.26+0xfd/0x140 drivers/net/ppp/ppp_generic.c:572 ppp_get_filter drivers/net/ppp/ppp_generic.c:584 [inline] ppp_ioctl+0x11db/0x2811 drivers/net/ppp/ppp_generic.c:787 vfs_ioctl fs/ioctl.c:47 [inline] file_ioctl fs/ioctl.c:539 [inline] do_vfs_ioctl+0x196/0x1150 fs/ioctl.c:726 ksys_ioctl+0x62/0x90 fs/ioctl.c:743 __do_sys_ioctl fs/ioctl.c:750 [inline] __se_sys_ioctl fs/ioctl.c:748 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:748 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 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:00007f7571313c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004598e9 RDX: 00000000200000c0 RSI: 0000000040107447 RDI: 0000000000000003 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f75713146d4 R13: 00000000004c3579 R14: 00000000004d6e40 R15: 00000000ffffffff Allocated by task 8864: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.constprop.9+0xc7/0xd0 mm/kasan/common.c:493 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:507 __do_kmalloc mm/slab.c:3655 [inline] __kmalloc_track_caller+0x160/0x780 mm/slab.c:3670 memdup_user+0x27/0x80 mm/util.c:165 get_filter.isra.26+0xab/0x140 drivers/net/ppp/ppp_generic.c:568 ppp_get_filter drivers/net/ppp/ppp_generic.c:584 [inline] ppp_ioctl+0x11db/0x2811 drivers/net/ppp/ppp_generic.c:787 vfs_ioctl fs/ioctl.c:47 [inline] file_ioctl fs/ioctl.c:539 [inline] do_vfs_ioctl+0x196/0x1150 fs/ioctl.c:726 ksys_ioctl+0x62/0x90 fs/ioctl.c:743 __do_sys_ioctl fs/ioctl.c:750 [inline] __se_sys_ioctl fs/ioctl.c:748 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:748 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8470: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 __cache_free mm/slab.c:3425 [inline] kfree+0x108/0x2c0 mm/slab.c:3756 tomoyo_realpath_from_path+0x173/0x7a0 security/tomoyo/realpath.c:319 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x203/0x380 security/tomoyo/file.c:822 tomoyo_inode_getattr+0x13/0x20 security/tomoyo/tomoyo.c:129 security_inode_getattr+0xb0/0x100 security/security.c:1182 vfs_getattr+0x1c/0x40 fs/stat.c:115 vfs_statx_fd+0x45/0x90 fs/stat.c:145 vfs_fstat include/linux/fs.h:3211 [inline] __do_sys_newfstat+0x79/0xd0 fs/stat.c:378 __se_sys_newfstat fs/stat.c:375 [inline] __x64_sys_newfstat+0x4f/0x70 fs/stat.c:375 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809403e1c0 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 0 bytes inside of 4096-byte region [ffff88809403e1c0, ffff88809403f1c0) The buggy address belongs to the page: page:ffffea0002500f80 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00024fec08 ffffea00024f9088 ffff8880aa402000 raw: 0000000000000000 ffff88809403e1c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809403f080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88809403f100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88809403f180: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff88809403f200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809403f280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================