================================================================== BUG: KASAN: use-after-free in get_max_inline_xattr_value_size+0x387/0x530 fs/ext4/inline.c:62 Read of size 4 at addr ffff88811a9b9084 by task syz-executor294/430 CPU: 1 PID: 430 Comm: syz-executor294 Not tainted 5.15.78-syzkaller-00911-gc73b4619ad86 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3d0 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x1a6/0x1f0 mm/kasan/report.c:452 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 get_max_inline_xattr_value_size+0x387/0x530 fs/ext4/inline.c:62 ext4_get_max_inline_size+0x142/0x200 fs/ext4/inline.c:113 ext4_try_to_write_inline_data+0xdd/0x11e0 fs/ext4/inline.c:677 ext4_write_begin+0x23b/0x1360 fs/ext4/inode.c:1172 ext4_da_write_begin+0x4ac/0xbf0 fs/ext4/inode.c:2979 generic_perform_write+0x2cd/0x5d0 mm/filemap.c:3825 ext4_buffered_write_iter+0x49b/0x630 fs/ext4/file.c:271 ext4_file_write_iter+0x448/0x1cc0 call_write_iter include/linux/fs.h:2138 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xc8d/0x1050 fs/read_write.c:594 ksys_write+0x198/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 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7feccd6e7529 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff3d2b4c98 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007feccd6e7529 RDX: 0000000000000018 RSI: 0000000020000700 RDI: 0000000000000004 RBP: 0000000000000000 R08: 00007feccd755ec0 R09: 00007feccd755ec0 R10: 00007feccd755ec0 R11: 0000000000000246 R12: 00007fff3d2b4cc0 R13: 0000000000000000 R14: 431bde82d7b634db R15: 0000000000000000 Allocated by task 316: 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_slab_alloc+0xb2/0xe0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook mm/slab.h:550 [inline] slab_alloc_node mm/slub.c:3236 [inline] slab_alloc mm/slub.c:3244 [inline] kmem_cache_alloc+0x189/0x2f0 mm/slub.c:3249 skb_clone+0x1df/0x3d0 net/core/skbuff.c:1547 dev_queue_xmit_nit+0x283/0xa60 net/core/dev.c:2297 xmit_one+0x88/0x480 net/core/dev.c:3592 dev_hard_start_xmit+0xad/0x1c0 net/core/dev.c:3613 sch_direct_xmit+0x295/0x9b0 net/sched/sch_generic.c:342 __dev_xmit_skb+0xb93/0x1650 net/core/dev.c:3824 __dev_queue_xmit+0x8f3/0x1b50 net/core/dev.c:4193 dev_queue_xmit+0x17/0x20 net/core/dev.c:4261 neigh_hh_output include/net/neighbour.h:508 [inline] neigh_output include/net/neighbour.h:522 [inline] ip_finish_output2+0xc0f/0xf00 net/ipv4/ip_output.c:228 __ip_finish_output+0x163/0x370 ip_finish_output+0x20b/0x220 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:299 [inline] ip_output+0x1e9/0x410 net/ipv4/ip_output.c:430 dst_output include/net/dst.h:450 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] __ip_queue_xmit+0x10b1/0x1be0 net/ipv4/ip_output.c:532 ip_queue_xmit+0x4b/0x70 net/ipv4/ip_output.c:546 __tcp_transmit_skb+0x1ef4/0x3a20 net/ipv4/tcp_output.c:1403 __tcp_send_ack+0x2f4/0x700 net/ipv4/tcp_output.c:3989 tcp_send_ack+0x3a/0x50 net/ipv4/tcp_output.c:3995 tcp_cleanup_rbuf+0x27f/0x5d0 net/ipv4/tcp.c:1602 tcp_recvmsg_locked+0x22a7/0x2920 net/ipv4/tcp.c:2529 tcp_recvmsg+0x269/0x870 net/ipv4/tcp.c:2560 inet_recvmsg+0x157/0x500 net/ipv4/af_inet.c:858 sock_recvmsg_nosec net/socket.c:947 [inline] sock_recvmsg net/socket.c:965 [inline] sock_read_iter+0x3a7/0x4d0 net/socket.c:1038 call_read_iter include/linux/fs.h:2132 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0xabc/0xd80 fs/read_write.c:485 ksys_read+0x198/0x2c0 fs/read_write.c:623 __do_sys_read fs/read_write.c:633 [inline] __se_sys_read fs/read_write.c:631 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 316: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/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:220 [inline] slab_free_hook mm/slub.c:1721 [inline] slab_free_freelist_hook+0xc9/0x1a0 mm/slub.c:1747 slab_free mm/slub.c:3515 [inline] kmem_cache_free+0x11a/0x2e0 mm/slub.c:3531 __kfree_skb+0x13e/0x1c0 net/core/skbuff.c:758 consume_skb+0x72/0x1f0 net/core/skbuff.c:930 packet_rcv+0x157/0x1430 net/packet/af_packet.c:2183 dev_queue_xmit_nit+0x9cd/0xa60 net/core/dev.c:2329 xmit_one+0x88/0x480 net/core/dev.c:3592 dev_hard_start_xmit+0xad/0x1c0 net/core/dev.c:3613 sch_direct_xmit+0x295/0x9b0 net/sched/sch_generic.c:342 __dev_xmit_skb+0xb93/0x1650 net/core/dev.c:3824 __dev_queue_xmit+0x8f3/0x1b50 net/core/dev.c:4193 dev_queue_xmit+0x17/0x20 net/core/dev.c:4261 neigh_hh_output include/net/neighbour.h:508 [inline] neigh_output include/net/neighbour.h:522 [inline] ip_finish_output2+0xc0f/0xf00 net/ipv4/ip_output.c:228 __ip_finish_output+0x163/0x370 ip_finish_output+0x20b/0x220 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:299 [inline] ip_output+0x1e9/0x410 net/ipv4/ip_output.c:430 dst_output include/net/dst.h:450 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] __ip_queue_xmit+0x10b1/0x1be0 net/ipv4/ip_output.c:532 ip_queue_xmit+0x4b/0x70 net/ipv4/ip_output.c:546 __tcp_transmit_skb+0x1ef4/0x3a20 net/ipv4/tcp_output.c:1403 __tcp_send_ack+0x2f4/0x700 net/ipv4/tcp_output.c:3989 tcp_send_ack+0x3a/0x50 net/ipv4/tcp_output.c:3995 tcp_cleanup_rbuf+0x27f/0x5d0 net/ipv4/tcp.c:1602 tcp_recvmsg_locked+0x22a7/0x2920 net/ipv4/tcp.c:2529 tcp_recvmsg+0x269/0x870 net/ipv4/tcp.c:2560 inet_recvmsg+0x157/0x500 net/ipv4/af_inet.c:858 sock_recvmsg_nosec net/socket.c:947 [inline] sock_recvmsg net/socket.c:965 [inline] sock_read_iter+0x3a7/0x4d0 net/socket.c:1038 call_read_iter include/linux/fs.h:2132 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0xabc/0xd80 fs/read_write.c:485 ksys_read+0x198/0x2c0 fs/read_write.c:623 __do_sys_read fs/read_write.c:633 [inline] __se_sys_read fs/read_write.c:631 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88811a9b9000 which belongs to the cache skbuff_head_cache of size 248 The buggy address is located 132 bytes inside of 248-byte region [ffff88811a9b9000, ffff88811a9b90f8) The buggy address belongs to the page: page:ffffea00046a6e40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11a9b9 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881087d3200 raw: 0000000000000000 00000000000c000c 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 316, ts 11127644083, free_ts 10964759012 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1ab/0x1b0 mm/page_alloc.c:2495 prep_new_page mm/page_alloc.c:2501 [inline] get_page_from_freelist+0x38b/0x400 mm/page_alloc.c:4281 __alloc_pages+0x3a8/0x7c0 mm/page_alloc.c:5548 allocate_slab+0x62/0x580 mm/slub.c:1928 new_slab mm/slub.c:1991 [inline] ___slab_alloc+0x2e2/0x6f0 mm/slub.c:3024 __slab_alloc+0x4a/0x90 mm/slub.c:3111 slab_alloc_node mm/slub.c:3202 [inline] slab_alloc mm/slub.c:3244 [inline] kmem_cache_alloc+0x205/0x2f0 mm/slub.c:3249 skb_clone+0x1df/0x3d0 net/core/skbuff.c:1547 dev_queue_xmit_nit+0x283/0xa60 net/core/dev.c:2297 xmit_one+0x88/0x480 net/core/dev.c:3592 dev_hard_start_xmit+0xad/0x1c0 net/core/dev.c:3613 sch_direct_xmit+0x295/0x9b0 net/sched/sch_generic.c:342 __dev_xmit_skb+0xb93/0x1650 net/core/dev.c:3824 __dev_queue_xmit+0x8f3/0x1b50 net/core/dev.c:4193 dev_queue_xmit+0x17/0x20 net/core/dev.c:4261 neigh_hh_output include/net/neighbour.h:508 [inline] neigh_output include/net/neighbour.h:522 [inline] ip_finish_output2+0xc0f/0xf00 net/ipv4/ip_output.c:228 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1364 [inline] free_pcp_prepare+0x448/0x450 mm/page_alloc.c:1435 free_unref_page_prepare mm/page_alloc.c:3433 [inline] free_unref_page+0x9c/0x370 mm/page_alloc.c:3513 __put_single_page mm/swap.c:98 [inline] __put_page+0xb0/0xd0 mm/swap.c:129 put_page include/linux/mm.h:1288 [inline] anon_pipe_buf_release+0x17b/0x1e0 fs/pipe.c:137 pipe_buf_release include/linux/pipe_fs_i.h:203 [inline] pipe_read+0x5c1/0x1060 fs/pipe.c:323 call_read_iter include/linux/fs.h:2132 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0xabc/0xd80 fs/read_write.c:485 ksys_read+0x198/0x2c0 fs/read_write.c:623 __do_sys_read fs/read_write.c:633 [inline] __se_sys_read fs/read_write.c:631 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff88811a9b8f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811a9b9000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88811a9b9080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc ^ ffff88811a9b9100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88811a9b9180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop0): ext4_read_block_bitmap_nowait:437: comm syz-executor294: Invalid block bitmap block 0 in block_group 0 syz-executor294 (430) used greatest stack depth: 21792 bytes left