EXT4-fs error (device loop2): ext4_xattr_ibody_get:619: inode #18: comm syz-executor.2: corrupted in-inode xattr ================================================================== BUG: KASAN: use-after-free in get_max_inline_xattr_value_size+0x36e/0x510 fs/ext4/inline.c:62 Read of size 4 at addr ffff8881160fd004 by task syz-executor.2/30765 CPU: 0 PID: 30765 Comm: syz-executor.2 Not tainted 6.1.25-syzkaller-00028-gf6707f352b54 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 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 get_max_inline_xattr_value_size+0x36e/0x510 fs/ext4/inline.c:62 ext4_get_max_inline_size+0x13d/0x1f0 fs/ext4/inline.c:113 ext4_try_to_write_inline_data+0xd3/0x1420 fs/ext4/inline.c:663 ext4_write_begin+0x200/0xfb0 fs/ext4/inode.c:1179 ext4_da_write_begin+0x2ff/0x920 fs/ext4/inode.c:2987 generic_perform_write+0x2f9/0x5c0 mm/filemap.c:3765 ext4_buffered_write_iter+0x360/0x640 fs/ext4/file.c:285 ext4_file_write_iter+0x194/0x1cf0 call_write_iter include/linux/fs.h:2215 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x8d1/0xe80 fs/read_write.c:584 ksys_write+0x199/0x2c0 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:646 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0195c7cb29 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f01969da0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f0195d9bf80 RCX: 00007f0195c7cb29 RDX: 0000000000000001 RSI: 0000000020000280 RDI: 0000000000000004 RBP: 00007f0195cc847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f0195d9bf80 R15: 00007fff1d095388 Allocated by task 28348: 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_slab_alloc+0x6c/0x80 mm/kasan/common.c:333 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:768 slab_alloc_node mm/slub.c:3418 [inline] slab_alloc mm/slub.c:3426 [inline] __kmem_cache_alloc_lru mm/slub.c:3433 [inline] kmem_cache_alloc+0x175/0x2c0 mm/slub.c:3442 dst_alloc+0x164/0x1e0 net/core/dst.c:92 ip6_dst_alloc net/ipv6/route.c:344 [inline] icmp6_dst_alloc+0xf8/0x510 net/ipv6/route.c:3261 ndisc_send_skb+0x28b/0xdc0 net/ipv6/ndisc.c:488 ndisc_send_rs+0x47d/0x5f0 net/ipv6/ndisc.c:718 addrconf_rs_timer+0x2d1/0x600 net/ipv6/addrconf.c:3958 call_timer_fn+0x3b/0x2d0 kernel/time/timer.c:1480 expire_timers kernel/time/timer.c:1525 [inline] __run_timers+0x72a/0xa10 kernel/time/timer.c:1796 run_timer_softirq+0x69/0xf0 kernel/time/timer.c:1809 __do_softirq+0x1d8/0x661 kernel/softirq.c:613 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb4/0xc0 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496 call_rcu+0xec/0x1230 kernel/rcu/tree.c:2798 dst_release+0x9b/0xe0 net/core/dst.c:177 refdst_drop include/net/dst.h:256 [inline] skb_dst_drop include/net/dst.h:268 [inline] __dev_queue_xmit+0xa33/0x3660 net/core/dev.c:4221 dev_queue_xmit include/linux/netdevice.h:3072 [inline] neigh_resolve_output+0x6c0/0x7c0 net/core/neighbour.c:1583 neigh_output include/net/neighbour.h:554 [inline] ip6_finish_output2+0x104a/0x1820 net/ipv6/ip6_output.c:134 __ip6_finish_output net/ipv6/ip6_output.c:195 [inline] ip6_finish_output+0x5d9/0xb60 net/ipv6/ip6_output.c:206 NF_HOOK_COND include/linux/netfilter.h:294 [inline] ip6_output+0x1f7/0x4d0 net/ipv6/ip6_output.c:227 dst_output include/net/dst.h:444 [inline] NF_HOOK include/linux/netfilter.h:305 [inline] ndisc_send_skb+0x7cf/0xdc0 net/ipv6/ndisc.c:508 ndisc_send_rs+0x47d/0x5f0 net/ipv6/ndisc.c:718 addrconf_rs_timer+0x2d1/0x600 net/ipv6/addrconf.c:3958 call_timer_fn+0x3b/0x2d0 kernel/time/timer.c:1480 expire_timers kernel/time/timer.c:1525 [inline] __run_timers+0x72a/0xa10 kernel/time/timer.c:1796 run_timer_softirq+0x69/0xf0 kernel/time/timer.c:1809 __do_softirq+0x1d8/0x661 kernel/softirq.c:613 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb4/0xc0 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496 call_rcu+0xec/0x1230 kernel/rcu/tree.c:2798 dst_release+0x9b/0xe0 net/core/dst.c:177 refdst_drop include/net/dst.h:256 [inline] skb_dst_drop include/net/dst.h:268 [inline] __dev_queue_xmit+0xa33/0x3660 net/core/dev.c:4221 dev_queue_xmit include/linux/netdevice.h:3072 [inline] neigh_resolve_output+0x6c0/0x7c0 net/core/neighbour.c:1583 neigh_output include/net/neighbour.h:554 [inline] ip6_finish_output2+0x104a/0x1820 net/ipv6/ip6_output.c:134 __ip6_finish_output net/ipv6/ip6_output.c:195 [inline] ip6_finish_output+0x5d9/0xb60 net/ipv6/ip6_output.c:206 NF_HOOK_COND include/linux/netfilter.h:294 [inline] ip6_output+0x1f7/0x4d0 net/ipv6/ip6_output.c:227 dst_output include/net/dst.h:444 [inline] NF_HOOK include/linux/netfilter.h:305 [inline] mld_sendpack+0x803/0xe40 net/ipv6/mcast.c:1820 mld_send_cr net/ipv6/mcast.c:2121 [inline] mld_ifc_work+0x7dc/0xba0 net/ipv6/mcast.c:2653 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2296 worker_thread+0xa60/0x1260 kernel/workqueue.c:2443 kthread+0x26d/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff8881160fd000 which belongs to the cache ip6_dst_cache of size 248 The buggy address is located 4 bytes inside of 248-byte region [ffff8881160fd000, ffff8881160fd0f8) The buggy address belongs to the physical page: page:ffffea0004583f40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8881160fd640 pfn:0x1160fd flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea00049e9d88 ffffea000610f448 ffff888100aa8f00 raw: ffff8881160fd640 00000000000c0003 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 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 16033, tgid 16033 (kworker/0:10), ts 3034958237121, free_ts 2871833751840 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2581 prep_new_page mm/page_alloc.c:2588 [inline] get_page_from_freelist+0x276c/0x2850 mm/page_alloc.c:4385 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5662 allocate_slab mm/slub.c:1959 [inline] new_slab+0xce/0x4c0 mm/slub.c:2012 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3200 __slab_alloc+0x5d/0xa0 mm/slub.c:3299 slab_alloc_node mm/slub.c:3384 [inline] slab_alloc mm/slub.c:3426 [inline] __kmem_cache_alloc_lru mm/slub.c:3433 [inline] kmem_cache_alloc+0x1b9/0x2c0 mm/slub.c:3442 dst_alloc+0x164/0x1e0 net/core/dst.c:92 ip6_dst_alloc net/ipv6/route.c:344 [inline] ip6_rt_pcpu_alloc net/ipv6/route.c:1369 [inline] rt6_make_pcpu_route net/ipv6/route.c:1417 [inline] ip6_pol_route+0xc25/0x1430 net/ipv6/route.c:2254 ip6_pol_route_input+0x55/0x80 net/ipv6/route.c:2275 pol_lookup_func include/net/ip6_fib.h:592 [inline] fib6_rule_lookup+0x25a/0x620 net/ipv6/fib6_rules.c:116 ip6_route_input_lookup net/ipv6/route.c:2287 [inline] ip6_route_input+0x730/0xc50 net/ipv6/route.c:2583 ip6_rcv_finish_core net/ipv6/ip6_input.c:66 [inline] ip6_rcv_finish+0x150/0x350 net/ipv6/ip6_input.c:77 NF_HOOK include/linux/netfilter.h:305 [inline] ipv6_rcv+0xeb/0x270 net/ipv6/ip6_input.c:309 __netif_receive_skb_one_core net/core/dev.c:5499 [inline] __netif_receive_skb+0x1c6/0x530 net/core/dev.c:5613 process_backlog+0x32c/0x630 net/core/dev.c:5941 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1493 [inline] free_pcp_prepare mm/page_alloc.c:1567 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3484 free_unref_page+0x8d/0x480 mm/page_alloc.c:3580 free_the_page mm/page_alloc.c:793 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5751 __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+0xbc5/0x2a40 kernel/exit.c:872 do_group_exit+0x21a/0x2d0 kernel/exit.c:1022 get_signal+0x169d/0x1820 kernel/signal.c:2861 arch_do_signal_or_restart+0xb0/0x16f0 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x6b/0xa0 kernel/entry/common.c:168 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x26/0x130 kernel/entry/common.c:297 Memory state around the buggy address: ffff8881160fcf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881160fcf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881160fd000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881160fd080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc ffff8881160fd100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ==================================================================