================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xc67/0xc80 fs/ext4/xattr.c:2894 Read of size 4 at addr ffff8881182c8000 by task syz-executor121/289 CPU: 0 PID: 289 Comm: syz-executor121 Not tainted 5.10.218-syzkaller-00638-g3feee789f446 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_xattr_delete_inode+0xc67/0xc80 fs/ext4/xattr.c:2894 ext4_evict_inode+0x1095/0x1730 fs/ext4/inode.c:300 evict+0x2a3/0x6c0 fs/inode.c:577 iput_final fs/inode.c:1697 [inline] iput+0x632/0x7e0 fs/inode.c:1723 d_delete_notify include/linux/fsnotify.h:261 [inline] vfs_rmdir+0x271/0x3f0 fs/namei.c:3865 do_rmdir+0x2cf/0x5c0 fs/namei.c:3912 __do_sys_rmdir fs/namei.c:3930 [inline] __se_sys_rmdir fs/namei.c:3928 [inline] __x64_sys_rmdir+0x49/0x50 fs/namei.c:3928 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f71ff77fdc7 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:00007fff2791b288 EFLAGS: 00000207 ORIG_RAX: 0000000000000054 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f71ff77fdc7 RDX: 0000000000008890 RSI: 0000000000000000 RDI: 00007fff2791c430 RBP: 0000000000000065 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007fff2791c430 R13: 0000555555be7740 R14: 431bde82d7b634db R15: 00007fff2791e5b0 Allocated by task 0: (stack is not available) Freed by task 239: 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+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc3/0x270 mm/slub.c:4191 skb_free_head net/core/skbuff.c:606 [inline] skb_release_data+0x5c6/0x6f0 net/core/skbuff.c:626 skb_release_all net/core/skbuff.c:680 [inline] __kfree_skb net/core/skbuff.c:694 [inline] consume_skb+0xac/0x250 net/core/skbuff.c:851 __dev_kfree_skb_any+0x159/0x180 net/core/dev.c:3134 dev_consume_skb_any include/linux/netdevice.h:3911 [inline] napi_consume_skb+0x24a/0x490 net/core/skbuff.c:913 free_old_xmit_skbs+0x119/0x290 drivers/net/virtio_net.c:1468 start_xmit+0x117/0x14c0 drivers/net/virtio_net.c:1687 __netdev_start_xmit include/linux/netdevice.h:4858 [inline] netdev_start_xmit include/linux/netdevice.h:4872 [inline] xmit_one net/core/dev.c:3607 [inline] dev_hard_start_xmit+0x228/0x620 net/core/dev.c:3623 sch_direct_xmit+0x292/0x9b0 net/sched/sch_generic.c:336 qdisc_restart net/sched/sch_generic.c:401 [inline] __qdisc_run+0xa85/0x1df0 net/sched/sch_generic.c:409 qdisc_run+0x121/0x330 include/net/pkt_sched.h:127 __dev_xmit_skb net/core/dev.c:3799 [inline] __dev_queue_xmit+0xcf0/0x28e0 net/core/dev.c:4155 dev_queue_xmit+0x17/0x20 net/core/dev.c:4223 neigh_resolve_output+0x6b8/0x760 net/core/neighbour.c:1509 neigh_output include/net/neighbour.h:517 [inline] ip_finish_output2+0xb7a/0xfc0 net/ipv4/ip_output.c:237 __ip_finish_output+0x409/0x740 ip_finish_output+0x34/0x1e0 net/ipv4/ip_output.c:325 NF_HOOK_COND include/linux/netfilter.h:288 [inline] ip_output+0x1d6/0x420 net/ipv4/ip_output.c:439 dst_output include/net/dst.h:437 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] __ip_queue_xmit+0x10ca/0x1bd0 net/ipv4/ip_output.c:540 ip_queue_xmit+0x4c/0x70 net/ipv4/ip_output.c:554 __tcp_transmit_skb+0x1ddd/0x3850 net/ipv4/tcp_output.c:1401 tcp_transmit_skb net/ipv4/tcp_output.c:1419 [inline] tcp_write_xmit+0x1563/0x5e10 net/ipv4/tcp_output.c:2701 __tcp_push_pending_frames+0x98/0x2f0 net/ipv4/tcp_output.c:2882 tcp_push+0x476/0x620 net/ipv4/tcp.c:741 tcp_sendmsg_locked+0x3092/0x3ae0 net/ipv4/tcp.c:1422 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1452 inet_sendmsg+0xa1/0xc0 net/ipv4/af_inet.c:824 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] sock_write_iter+0x39b/0x530 net/socket.c:1018 call_write_iter include/linux/fs.h:2021 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xb55/0xe70 fs/read_write.c:605 ksys_write+0x199/0x2c0 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff8881182c8000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 0 bytes inside of 1024-byte region [ffff8881182c8000, ffff8881182c8400) The buggy address belongs to the page: page:ffffea000460b200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1182c8 head:ffffea000460b200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 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 3, migratetype Unmovable, gfp_mask 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 239, ts 14863806133, free_ts 14863792022 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] __kmalloc_track_caller+0x1f8/0x320 mm/slub.c:4536 __kmalloc_reserve net/core/skbuff.c:144 [inline] __alloc_skb+0xbc/0x510 net/core/skbuff.c:212 alloc_skb include/linux/skbuff.h:1126 [inline] __tcp_send_ack+0x95/0x6d0 net/ipv4/tcp_output.c:3982 tcp_send_ack+0x3b/0x60 net/ipv4/tcp_output.c:4014 tcp_cleanup_rbuf+0x278/0x590 net/ipv4/tcp.c:1592 tcp_recvmsg+0x2192/0x3590 net/ipv4/tcp.c:2361 inet_recvmsg+0x158/0x500 net/ipv4/af_inet.c:855 sock_recvmsg_nosec net/socket.c:905 [inline] sock_recvmsg net/socket.c:923 [inline] sock_read_iter+0x353/0x480 net/socket.c:996 call_read_iter include/linux/fs.h:2015 [inline] new_sync_read fs/read_write.c:415 [inline] vfs_read+0x999/0xbb0 fs/read_write.c:496 ksys_read+0x199/0x2c0 fs/read_write.c:634 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] __free_pages_ok+0x82c/0x850 mm/page_alloc.c:1629 free_compound_page+0x73/0x90 mm/page_alloc.c:710 destroy_compound_page include/linux/mm.h:959 [inline] __put_compound_page+0x73/0xb0 mm/swap.c:117 __put_page+0xc0/0xe0 mm/swap.c:133 put_page include/linux/mm.h:1257 [inline] __skb_frag_unref include/linux/skbuff.h:3100 [inline] skb_release_data+0x240/0x6f0 net/core/skbuff.c:620 skb_release_all net/core/skbuff.c:680 [inline] __kfree_skb+0x50/0x70 net/core/skbuff.c:694 sk_eat_skb include/net/sock.h:2644 [inline] tcp_recvmsg+0x1765/0x3590 net/ipv4/tcp.c:2345 inet_recvmsg+0x158/0x500 net/ipv4/af_inet.c:855 sock_recvmsg_nosec net/socket.c:905 [inline] sock_recvmsg net/socket.c:923 [inline] sock_read_iter+0x353/0x480 net/socket.c:996 call_read_iter include/linux/fs.h:2015 [inline] new_sync_read fs/read_write.c:415 [inline] vfs_read+0x999/0xbb0 fs/read_write.c:496 ksys_read+0x199/0x2c0 fs/read_write.c:634 __do_sys_read fs/read_write.c:644 [inline] __se_sys_read fs/read_write.c:642 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:642 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff8881182c7f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881182c7f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881182c8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881182c8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881182c8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================