================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2905 Read of size 4 at addr ffff88811172c000 by task syz-executor/470 CPU: 0 PID: 470 Comm: syz-executor Not tainted 6.1.93-syzkaller-1151427-gd1f3a046a65d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/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:2905 ext4_evict_inode+0xef9/0x1550 fs/ext4/inode.c:296 evict+0x2a3/0x630 fs/inode.c:666 iput_final fs/inode.c:1791 [inline] iput+0x616/0x690 fs/inode.c:1817 d_delete_notify include/linux/fsnotify.h:286 [inline] vfs_rmdir+0x3c2/0x500 fs/namei.c:4205 do_rmdir+0x3ab/0x630 fs/namei.c:4253 __do_sys_unlinkat fs/namei.c:4433 [inline] __se_sys_unlinkat fs/namei.c:4427 [inline] __x64_sys_unlinkat+0xdf/0xf0 fs/namei.c:4427 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:0x7f7f83b79457 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:00007fffab32f588 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f7f83b79457 RDX: 0000000000000200 RSI: 00007fffab330730 RDI: 00000000ffffff9c RBP: 00007f7f83be77b4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007fffab330730 R13: 00007f7f83be77b4 R14: 000000000000cbba R15: 00007fffab3328e0 Allocated by task 470: 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:957 [inline] __kmalloc_node_track_caller+0xb3/0x1e0 mm/slab_common.c:977 kmalloc_reserve net/core/skbuff.c:446 [inline] __alloc_skb+0x125/0x2d0 net/core/skbuff.c:515 alloc_skb include/linux/skbuff.h:1290 [inline] nlmsg_new include/net/netlink.h:991 [inline] netlink_ack+0x392/0x12a0 net/netlink/af_netlink.c:2455 netlink_rcv_skb+0x24a/0x410 net/netlink/af_netlink.c:2524 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6139 netlink_unicast_kernel net/netlink/af_netlink.c:1327 [inline] netlink_unicast+0x906/0xab0 net/netlink/af_netlink.c:1353 netlink_sendmsg+0xa15/0xd30 net/netlink/af_netlink.c:1875 sock_sendmsg_nosec net/socket.c:716 [inline] __sock_sendmsg net/socket.c:728 [inline] __sys_sendto+0x480/0x600 net/socket.c:2138 __do_sys_sendto net/socket.c:2150 [inline] __se_sys_sendto net/socket.c:2146 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2146 x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45 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 470: 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:3684 [inline] __kmem_cache_free+0x218/0x3b0 mm/slub.c:3697 kfree+0x7a/0xf0 mm/slab_common.c:1009 skb_free_head net/core/skbuff.c:762 [inline] skb_release_data+0x616/0x840 net/core/skbuff.c:791 skb_release_all net/core/skbuff.c:856 [inline] __kfree_skb net/core/skbuff.c:870 [inline] consume_skb+0xac/0x250 net/core/skbuff.c:1035 skb_free_datagram+0x15/0x20 net/core/datagram.c:322 netlink_recvmsg+0x61a/0x1180 net/netlink/af_netlink.c:1953 sock_recvmsg_nosec net/socket.c:1020 [inline] sock_recvmsg net/socket.c:1038 [inline] __sys_recvfrom+0x353/0x4d0 net/socket.c:2190 __do_sys_recvfrom net/socket.c:2208 [inline] __se_sys_recvfrom net/socket.c:2204 [inline] __x64_sys_recvfrom+0xe5/0x100 net/socket.c:2204 x64_sys_call+0x163/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:46 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 The buggy address belongs to the object at ffff88811172c000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff88811172c000, ffff88811172c200) The buggy address belongs to the physical page: page:ffffea000445cb00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11172c head:ffffea000445cb00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 0000000000000000 dead000000000122 ffff888100042f00 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 470, tgid 470 (syz-executor), ts 51896062048, free_ts 51235825198 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+0x27ea/0x2870 mm/page_alloc.c:4425 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5714 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+0x1af/0x250 mm/slub.c:3460 __do_kmalloc_node mm/slab_common.c:956 [inline] __kmalloc+0xa3/0x1e0 mm/slab_common.c:970 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:692 [inline] fib6_info_alloc+0x33/0xe0 net/ipv6/ip6_fib.c:156 ip6_route_info_create+0x50b/0x14c0 net/ipv6/route.c:3754 ip6_route_add+0x27/0x130 net/ipv6/route.c:3848 addrconf_prefix_route+0x312/0x4f0 net/ipv6/addrconf.c:2464 inet6_addr_add+0x54d/0x9f0 net/ipv6/addrconf.c:3020 inet6_rtm_newaddr+0x942/0x2780 net/ipv6/addrconf.c:4980 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1498 [inline] free_pcp_prepare mm/page_alloc.c:1572 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3498 free_unref_page+0xb2/0x5c0 mm/page_alloc.c:3594 free_the_page mm/page_alloc.c:798 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5803 __vunmap+0x9f3/0xb60 mm/vmalloc.c:2728 __vfree mm/vmalloc.c:2776 [inline] vfree+0x5c/0x80 mm/vmalloc.c:2807 kcov_put kernel/kcov.c:428 [inline] kcov_close+0x2b/0x50 kernel/kcov.c:524 __fput+0x3ab/0x870 fs/file_table.c:320 ____fput+0x15/0x20 fs/file_table.c:348 task_work_run+0x24d/0x2e0 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xbd5/0x2b80 kernel/exit.c:875 do_group_exit+0x21a/0x2d0 kernel/exit.c:1025 get_signal+0x169d/0x1820 kernel/signal.c:2880 arch_do_signal_or_restart+0xb0/0x16f0 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x74/0xa0 kernel/entry/common.c:174 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x26/0x130 kernel/entry/common.c:303 Memory state around the buggy address: ffff88811172bf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811172bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88811172c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811172c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811172c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor: inode #1: comm syz-executor: iget: illegal inode # EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor: error while reading EA inode 1 err=-117 EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor: inode #1: comm syz-executor: iget: illegal inode # EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor: error while reading EA inode 1 err=-117 EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor: inode #1: comm syz-executor: iget: illegal inode # EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor: error while reading EA inode 1 err=-117 EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor: inode #1: comm syz-executor: iget: illegal inode # EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor: error while reading EA inode 1 err=-117