================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:376 [inline] BUG: KASAN: use-after-free in ext4_write_inline_data+0x2ae/0x380 fs/ext4/inline.c:251 Write of size 70 at addr ffff8880ab24b016 by task syz-executor.3/18054 CPU: 1 PID: 18054 Comm: syz-executor.3 Not tainted 4.14.232-syzkaller #0 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+0x1b2/0x281 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351 kasan_report+0x6f/0x80 mm/kasan/report.c:409 memcpy+0x35/0x50 mm/kasan/kasan.c:303 memcpy include/linux/string.h:376 [inline] ext4_write_inline_data+0x2ae/0x380 fs/ext4/inline.c:251 ext4_write_inline_data_end+0x1d3/0x490 fs/ext4/inline.c:760 ext4_write_end+0x18d/0xca0 fs/ext4/inode.c:1422 ext4_da_write_end+0x6da/0x8e0 fs/ext4/inode.c:3177 generic_perform_write+0x268/0x420 mm/filemap.c:3066 __generic_file_write_iter+0x227/0x590 mm/filemap.c:3180 ext4_file_write_iter+0x276/0xd20 fs/ext4/file.c:270 call_write_iter include/linux/fs.h:1778 [inline] new_sync_write fs/read_write.c:469 [inline] __vfs_write+0x44c/0x630 fs/read_write.c:482 vfs_write+0x17f/0x4d0 fs/read_write.c:544 SYSC_write fs/read_write.c:590 [inline] SyS_write+0xf2/0x210 fs/read_write.c:582 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb audit: type=1804 audit(1620316339.402:55): pid=18074 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir903766232/syzkaller.1XveGs/40/file0" dev="sda1" ino=14527 res=1 RIP: 0033:0x4665f9 RSP: 002b:00007f4f04cf0188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 00000000004665f9 RDX: 0000000000000082 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00000000004bfce1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007fffebd6f7af R14: 00007f4f04cf0300 R15: 0000000000022000 Allocated by task 17420: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551 kmem_cache_alloc+0x124/0x3c0 mm/slab.c:3552 getname_flags+0xc8/0x550 fs/namei.c:138 getname fs/namei.c:209 [inline] user_path_create fs/namei.c:3732 [inline] SYSC_symlinkat fs/namei.c:4176 [inline] SyS_symlinkat+0xa1/0x240 fs/namei.c:4163 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 17420: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kmem_cache_free+0x7c/0x2b0 mm/slab.c:3758 putname+0xcd/0x110 fs/namei.c:259 filename_create+0x1c1/0x3f0 fs/namei.c:3697 user_path_create fs/namei.c:3732 [inline] SYSC_symlinkat fs/namei.c:4176 [inline] SyS_symlinkat+0xb3/0x240 fs/namei.c:4163 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8880ab24aa80 which belongs to the cache names_cache of size 4096 The buggy address is located 1430 bytes inside of 4096-byte region [ffff8880ab24aa80, ffff8880ab24ba80) audit: type=1804 audit(1620316339.462:56): pid=18080 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir903766232/syzkaller.1XveGs/41/file0" dev="sda1" ino=14529 res=1 The buggy address belongs to the page: page:ffffea0002ac9280 count:1 mapcount:0 mapping:ffff8880ab24aa80 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffff8880ab24aa80 0000000000000000 0000000100000001 raw: ffffea0002bd6120 ffffea0001a3da20 ffff88823f8bb200 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880ab24af00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880ab24af80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880ab24b000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880ab24b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880ab24b100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================