================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2910 Read of size 4 at addr ffff88810ce04000 by task syz-executor390/295 CPU: 0 PID: 295 Comm: syz-executor390 Not tainted 5.15.167-syzkaller-android13-5.15.167_r00 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2910 ext4_evict_inode+0xea1/0x14e0 fs/ext4/inode.c:300 evict+0x529/0x930 fs/inode.c:622 iput_final fs/inode.c:1740 [inline] iput+0x63b/0x7e0 fs/inode.c:1766 d_delete_notify include/linux/fsnotify.h:278 [inline] vfs_rmdir+0x359/0x470 fs/namei.c:4162 do_rmdir+0x3ab/0x630 fs/namei.c:4210 __do_sys_rmdir fs/namei.c:4229 [inline] __se_sys_rmdir fs/namei.c:4227 [inline] __x64_sys_rmdir+0x49/0x50 fs/namei.c:4227 x64_sys_call+0x274/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:85 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f76d543fdc7 Code: 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 54 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc44203798 EFLAGS: 00000207 ORIG_RAX: 0000000000000054 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f76d543fdc7 RDX: 0000000000008890 RSI: 0000000000000000 RDI: 00007ffc44204940 RBP: 0000000000000065 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffc44204940 R13: 00005555640ef740 R14: 431bde82d7b634db R15: 00007ffc44206ac0 Allocated by task 112: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] __kmalloc+0x13a/0x270 mm/slub.c:4427 kmalloc include/linux/slab.h:608 [inline] kzalloc include/linux/slab.h:733 [inline] kobject_get_path+0xbc/0x1f0 lib/kobject.c:184 kobject_uevent_env+0x27f/0x700 lib/kobject_uevent.c:544 kobject_synth_uevent+0x4eb/0xae0 lib/kobject_uevent.c:208 uevent_store+0x25/0x60 drivers/base/core.c:2441 dev_attr_store+0x5c/0x80 drivers/base/core.c:2137 sysfs_kf_write+0x123/0x140 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x2c4/0x410 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2204 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xd5d/0x1110 fs/read_write.c:594 ksys_write+0x199/0x2c0 fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:656 x64_sys_call+0x2f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 112: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3519 [inline] kfree+0xc8/0x220 mm/slub.c:4579 kobject_uevent_env+0x334/0x700 lib/kobject_uevent.c:640 kobject_synth_uevent+0x4eb/0xae0 lib/kobject_uevent.c:208 uevent_store+0x25/0x60 drivers/base/core.c:2441 dev_attr_store+0x5c/0x80 drivers/base/core.c:2137 sysfs_kf_write+0x123/0x140 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x2c4/0x410 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2204 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xd5d/0x1110 fs/read_write.c:594 ksys_write+0x199/0x2c0 fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:656 x64_sys_call+0x2f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88810ce04000 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 0 bytes inside of 96-byte region [ffff88810ce04000, ffff88810ce04060) The buggy address belongs to the page: page:ffffea0004338100 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88810ce04c80 pfn:0x10ce04 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea0004344580 0000001a0000001a ffff888100042900 raw: ffff88810ce04c80 000000008020001b 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY), pid 100, ts 3437429842, free_ts 3433489162 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3248 [inline] __kmalloc+0x16d/0x270 mm/slub.c:4423 kmalloc_array include/linux/slab.h:643 [inline] kcalloc include/linux/slab.h:672 [inline] ext4_find_extent+0x370/0xdb0 fs/ext4/extents.c:907 ext4_ext_map_blocks+0x269/0x7450 fs/ext4/extents.c:4144 ext4_map_blocks+0x408/0x1c70 fs/ext4/inode.c:600 ext4_mpage_readpages+0xb50/0x1f30 fs/ext4/readpage.c:343 ext4_readahead+0xe2/0x110 fs/ext4/inode.c:3265 read_pages+0x15e/0xb00 mm/readahead.c:141 page_cache_ra_unbounded+0x6cb/0x920 mm/readahead.c:250 do_page_cache_ra mm/readahead.c:280 [inline] ondemand_readahead+0x9c8/0xfa0 mm/readahead.c:565 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page_list+0x14b/0xa60 mm/page_alloc.c:3671 release_pages+0x1310/0x1370 mm/swap.c:1009 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:320 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:338 exit_mmap+0x40d/0x940 mm/mmap.c:3218 __mmput+0x95/0x310 kernel/fork.c:1179 mmput+0x5b/0x170 kernel/fork.c:1202 exec_mmap+0x46b/0x510 fs/exec.c:1049 begin_new_exec+0xbcf/0x1f40 fs/exec.c:1308 load_elf_binary+0x945/0x2750 fs/binfmt_elf.c:1001 search_binary_handler fs/exec.c:1757 [inline] exec_binprm fs/exec.c:1798 [inline] bprm_execve+0x7ae/0x14a0 fs/exec.c:1867 do_execveat_common+0x565/0x710 fs/exec.c:1972 do_execve fs/exec.c:2042 [inline] __do_sys_execve fs/exec.c:2118 [inline] __se_sys_execve fs/exec.c:2113 [inline] __x64_sys_execve+0x92/0xb0 fs/exec.c:2113 x64_sys_call+0x1c5/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:60 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff88810ce03f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88810ce03f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88810ce04000: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88810ce04080: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88810ce04100: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================