================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904 Read of size 4 at addr ffff88810da55000 by task syz-executor/481 CPU: 0 PID: 481 Comm: syz-executor Not tainted 6.1.115-syzkaller-1153154-gaffd0c026349 #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/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904 ext4_evict_inode+0xef9/0x1550 fs/ext4/inode.c:296 evict+0x529/0x930 fs/inode.c:701 iput_final fs/inode.c:1830 [inline] iput+0x616/0x690 fs/inode.c:1856 d_delete_notify include/linux/fsnotify.h:292 [inline] vfs_rmdir+0x3c2/0x500 fs/namei.c:4203 do_rmdir+0x3ab/0x630 fs/namei.c:4251 __do_sys_unlinkat fs/namei.c:4431 [inline] __se_sys_unlinkat fs/namei.c:4425 [inline] __x64_sys_unlinkat+0xdf/0xf0 fs/namei.c:4425 x64_sys_call+0x6e9/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:264 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f7a64979497 Code: 73 01 c3 48 c7 c1 a8 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 07 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffeaed201e8 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f7a64979497 RDX: 0000000000000200 RSI: 00007ffeaed21390 RDI: 00000000ffffff9c RBP: 00007f7a649e77dc R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffeaed21390 R13: 00007f7a649e77dc R14: 000000000000da7c R15: 00007ffeaed23540 Allocated by task 340: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:379 [inline] __kasan_kmalloc+0x9c/0xb0 mm/kasan/common.c:388 kasan_kmalloc include/linux/kasan.h:212 [inline] __do_kmalloc_node mm/slab_common.c:938 [inline] __kmalloc_node_track_caller+0xb3/0x1e0 mm/slab_common.c:958 kmemdup+0x29/0x60 mm/util.c:134 _Z7kmemdupPKvU17pass_object_size0mj include/linux/fortify-string.h:585 [inline] xt_register_table+0x113/0x700 net/netfilter/x_tables.c:1461 ipt_register_table+0x15f/0x730 net/ipv4/netfilter/ip_tables.c:1750 iptable_mangle_table_init+0x41/0x70 net/ipv4/netfilter/iptable_mangle.c:91 xt_find_table_lock+0x36e/0x440 net/netfilter/x_tables.c:1259 xt_request_find_table_lock+0x27/0xf0 net/netfilter/x_tables.c:1284 get_info net/ipv4/netfilter/ip_tables.c:965 [inline] do_ipt_get_ctl+0x854/0x1840 net/ipv4/netfilter/ip_tables.c:1661 nf_getsockopt+0x26c/0x290 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x1dd/0x290 net/ipv4/ip_sockglue.c:1826 tcp_getsockopt+0x15c/0x1c0 net/ipv4/tcp.c:4434 sock_common_getsockopt+0x99/0xb0 net/core/sock.c:3668 __sys_getsockopt+0x290/0x560 net/socket.c:2322 __do_sys_getsockopt net/socket.c:2337 [inline] __se_sys_getsockopt net/socket.c:2334 [inline] __x64_sys_getsockopt+0xbf/0xd0 net/socket.c:2334 x64_sys_call+0x1a9/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:56 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 8: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook mm/slub.c:1771 [inline] slab_free mm/slub.c:3686 [inline] __kmem_cache_free+0x21d/0x410 mm/slub.c:3702 kfree+0x7a/0xf0 mm/slab_common.c:990 xt_unregister_table+0x243/0x2f0 net/netfilter/x_tables.c:1511 __ipt_unregister_table net/ipv4/netfilter/ip_tables.c:1714 [inline] ipt_unregister_table_exit+0x6b/0x210 net/ipv4/netfilter/ip_tables.c:1807 iptable_mangle_net_exit+0x1c/0x20 net/ipv4/netfilter/iptable_mangle.c:103 ops_exit_list net/core/net_namespace.c:172 [inline] cleanup_net+0x64b/0xbf0 net/core/net_namespace.c:604 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2299 worker_thread+0xa60/0x1260 kernel/workqueue.c:2446 kthread+0x26d/0x300 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88810da55000 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 0 bytes inside of 96-byte region [ffff88810da55000, ffff88810da55060) The buggy address belongs to the physical page: page:ffffea0004369540 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10da55 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea000437bbc0 dead000000000003 ffff888100042900 raw: 0000000000000000 0000000000200020 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, tgid 1 (swapper/0), ts 2355270708, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597 get_page_from_freelist+0x2980/0x2a10 mm/page_alloc.c:4439 __alloc_pages+0x234/0x610 mm/page_alloc.c:5728 alloc_slab_page+0x6c/0xf0 allocate_slab mm/slub.c:1962 [inline] new_slab+0x90/0x3e0 mm/slub.c:2015 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3203 __slab_alloc+0x5d/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] __kmem_cache_alloc_node+0x207/0x2a0 mm/slub.c:3462 kmalloc_node_trace+0x26/0xb0 mm/slab_common.c:1041 kmalloc_node include/linux/slab.h:579 [inline] kzalloc_node include/linux/slab.h:704 [inline] blk_alloc_flush_queue+0x8a/0x270 block/blk-flush.c:477 blk_mq_alloc_hctx block/blk-mq.c:3747 [inline] blk_mq_alloc_and_init_hctx+0x854/0xdd0 block/blk-mq.c:4186 blk_mq_realloc_hw_ctxs+0x192/0x490 block/blk-mq.c:4219 blk_mq_init_allocated_queue+0x4c6/0x1660 block/blk-mq.c:4281 blk_mq_init_queue_data block/blk-mq.c:4091 [inline] blk_mq_init_queue+0xa1/0x120 block/blk-mq.c:4101 scsi_alloc_sdev+0x71b/0xb30 drivers/scsi/scsi_scan.c:335 page_owner free stack trace missing Memory state around the buggy address: ffff88810da54f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88810da54f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88810da55000: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88810da55080: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88810da55100: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ================================================================== EXT4-fs (loop3): unmounting filesystem. EXT4-fs (loop3): unmounting filesystem. EXT4-fs (loop3): unmounting filesystem. EXT4-fs (loop3): unmounting filesystem. EXT4-fs (loop3): unmounting filesystem. EXT4-fs (loop3): unmounting filesystem.