================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2910 Read of size 4 at addr ffff888100bed000 by task syz-executor325/295 CPU: 0 PID: 295 Comm: syz-executor325 Not tainted 5.15.167-syzkaller-02003-g5e4635681cf1 #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:0x7f0c625bbdc7 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:00007ffd290bd078 EFLAGS: 00000207 ORIG_RAX: 0000000000000054 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0c625bbdc7 RDX: 0000000000008890 RSI: 0000000000000000 RDI: 00007ffd290be220 RBP: 0000000000000065 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffd290be220 R13: 0000555589325740 R14: 431bde82d7b634db R15: 00007ffd290c03a0 Allocated by task 1: 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_track_caller+0x139/0x260 mm/slub.c:4950 kvasprintf+0xd6/0x180 lib/kasprintf.c:25 kvasprintf_const+0x5e/0x190 lib/kasprintf.c:49 kobject_set_name_vargs+0x61/0x120 lib/kobject.c:297 dev_set_name+0xd1/0x120 drivers/base/core.c:3213 scsi_sysfs_device_initialize+0x1ab/0x7d0 drivers/scsi/scsi_sysfs.c:1645 scsi_alloc_sdev+0x7a0/0xa10 drivers/scsi/scsi_scan.c:349 scsi_probe_and_add_lun+0x199/0x4320 drivers/scsi/scsi_scan.c:1156 __scsi_scan_target+0x1ed/0xe30 drivers/scsi/scsi_scan.c:1637 scsi_scan_channel drivers/scsi/scsi_scan.c:1725 [inline] scsi_scan_host_selected+0x334/0x5f0 drivers/scsi/scsi_scan.c:1754 do_scsi_scan_host drivers/scsi/scsi_scan.c:1893 [inline] scsi_scan_host+0x3a8/0x670 drivers/scsi/scsi_scan.c:1923 virtscsi_probe+0x930/0xc30 drivers/scsi/virtio_scsi.c:915 virtio_dev_probe+0x891/0xae0 drivers/virtio/virtio.c:273 really_probe+0x28d/0x970 drivers/base/dd.c:595 __driver_probe_device+0x1a0/0x310 drivers/base/dd.c:755 driver_probe_device+0x54/0x3d0 drivers/base/dd.c:785 __driver_attach+0x446/0x590 drivers/base/dd.c:1164 bus_for_each_dev+0x17b/0x1f0 drivers/base/bus.c:301 driver_attach+0x42/0x50 drivers/base/dd.c:1181 bus_add_driver+0x33f/0x590 drivers/base/bus.c:618 driver_register+0x2e2/0x3e0 drivers/base/driver.c:240 register_virtio_driver+0x97/0xc0 drivers/virtio/virtio.c:325 init+0x66/0xe0 drivers/scsi/virtio_scsi.c:1009 do_one_initcall+0x182/0x610 init/main.c:1302 do_initcall_level+0x186/0x310 init/main.c:1375 do_initcalls+0x4e/0x90 init/main.c:1391 do_basic_setup+0x81/0x90 init/main.c:1410 kernel_init_freeable+0x2c1/0x400 init/main.c:1615 kernel_init+0x1d/0x290 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the object at ffff888100bed000 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 0 bytes inside of 16-byte region [ffff888100bed000, ffff888100bed010) The buggy address belongs to the page: page:ffffea000402fb40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888100bed260 pfn:0x100bed flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea0004283440 0000000a0000000a ffff888100042480 raw: ffff888100bed260 0000000080800000 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 0x12c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 2357671639, free_ts 0 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_node include/linux/slab.h:469 [inline] kmalloc_array_node include/linux/slab.h:696 [inline] blk_mq_alloc_hctx block/blk-mq.c:2814 [inline] blk_mq_alloc_and_init_hctx block/blk-mq.c:3204 [inline] blk_mq_realloc_hw_ctxs+0x765/0x1790 block/blk-mq.c:3256 blk_mq_init_allocated_queue+0x449/0x16f0 block/blk-mq.c:3317 blk_mq_init_queue_data block/blk-mq.c:3152 [inline] blk_mq_init_queue+0x6b/0xd0 block/blk-mq.c:3162 scsi_alloc_sdev+0x674/0xa10 drivers/scsi/scsi_scan.c:319 scsi_probe_and_add_lun+0x199/0x4320 drivers/scsi/scsi_scan.c:1156 __scsi_scan_target+0x1ed/0xe30 drivers/scsi/scsi_scan.c:1637 scsi_scan_channel drivers/scsi/scsi_scan.c:1725 [inline] scsi_scan_host_selected+0x334/0x5f0 drivers/scsi/scsi_scan.c:1754 do_scsi_scan_host drivers/scsi/scsi_scan.c:1893 [inline] scsi_scan_host+0x3a8/0x670 drivers/scsi/scsi_scan.c:1923 page_owner free stack trace missing Memory state around the buggy address: ffff888100becf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888100becf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888100bed000: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc ^ ffff888100bed080: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc ffff888100bed100: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc ==================================================================