loop3: detected capacity change from 512 to 511 ================================================================== BUG: KASAN: slab-use-after-free in ext4_read_inline_data fs/ext4/inline.c:209 [inline] BUG: KASAN: slab-use-after-free in ext4_inlinedir_to_tree+0x57a/0x11d0 fs/ext4/inline.c:1365 Read of size 296 at addr ffff888032afb805 by task syz.3.192/7141 CPU: 0 UID: 0 PID: 7141 Comm: syz.3.192 Not tainted 6.11.0-rc6-syzkaller-00026-g88fac17500f4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 ext4_read_inline_data fs/ext4/inline.c:209 [inline] ext4_inlinedir_to_tree+0x57a/0x11d0 fs/ext4/inline.c:1365 ext4_htree_fill_tree+0x5d8/0x1400 fs/ext4/namei.c:1211 ext4_dx_readdir fs/ext4/dir.c:597 [inline] ext4_readdir+0x2b1c/0x3500 fs/ext4/dir.c:142 iterate_dir+0x57a/0x810 fs/readdir.c:108 __do_sys_getdents fs/readdir.c:324 [inline] __se_sys_getdents+0x1ef/0x4d0 fs/readdir.c:309 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1b2537cef9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1b261a3038 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007f1b25535f80 RCX: 00007f1b2537cef9 RDX: 0000000000000058 RSI: 0000000000000000 RDI: 0000000000000006 RBP: 00007f1b253ef01e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f1b25535f80 R15: 00007ffc9b67ff78 Allocated by task 12: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4080 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:664 alloc_skb include/linux/skbuff.h:1320 [inline] nlmsg_new include/net/netlink.h:1015 [inline] __neigh_notify+0x81/0x140 net/core/neighbour.c:3519 neigh_cleanup_and_release+0xb7/0x2a0 net/core/neighbour.c:101 neigh_flush_dev+0x188/0xaf0 net/core/neighbour.c:429 __neigh_ifdown+0x45/0x400 net/core/neighbour.c:446 neigh_carrier_down+0x22/0x30 net/core/neighbour.c:457 ndisc_netdev_event+0x401/0x4e0 net/ipv6/ndisc.c:1919 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 netdev_state_change+0x11f/0x1a0 net/core/dev.c:1376 linkwatch_do_dev+0x112/0x170 net/core/link_watch.c:177 __linkwatch_run_queue+0x44f/0x6c0 net/core/link_watch.c:234 linkwatch_event+0x4c/0x60 net/core/link_watch.c:277 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd10 kernel/workqueue.c:3389 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 12: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kmem_cache_free+0x145/0x350 mm/slub.c:4548 netlink_broadcast_filtered+0x116d/0x12a0 net/netlink/af_netlink.c:1542 nlmsg_multicast_filtered include/net/netlink.h:1125 [inline] nlmsg_multicast include/net/netlink.h:1144 [inline] nlmsg_notify+0xfb/0x1c0 net/netlink/af_netlink.c:2593 neigh_cleanup_and_release+0xb7/0x2a0 net/core/neighbour.c:101 neigh_flush_dev+0x188/0xaf0 net/core/neighbour.c:429 __neigh_ifdown+0x45/0x400 net/core/neighbour.c:446 neigh_carrier_down+0x22/0x30 net/core/neighbour.c:457 ndisc_netdev_event+0x401/0x4e0 net/ipv6/ndisc.c:1919 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 netdev_state_change+0x11f/0x1a0 net/core/dev.c:1376 linkwatch_do_dev+0x112/0x170 net/core/link_watch.c:177 __linkwatch_run_queue+0x44f/0x6c0 net/core/link_watch.c:234 linkwatch_event+0x4c/0x60 net/core/link_watch.c:277 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd10 kernel/workqueue.c:3389 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff888032afb780 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 133 bytes inside of freed 240-byte region [ffff888032afb780, ffff888032afb870) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x32afb flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff88801e6a5780 ffffea0000931300 0000000000000002 raw: 0000000000000000 00000000000c000c 00000001fdffffff 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5231, tgid 5231 (kworker/0:3), ts 191671985757, free_ts 191649300356 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3439 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4695 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] kmem_cache_alloc_node_noprof+0x1fe/0x320 mm/slub.c:4080 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:664 alloc_skb include/linux/skbuff.h:1320 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline] nsim_dev_trap_report_work+0x254/0xaa0 drivers/net/netdevsim/dev.c:850 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd10 kernel/workqueue.c:3389 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page last free pid 6921 tgid 6919 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_folios+0x100f/0x1ac0 mm/page_alloc.c:2660 folios_put_refs+0x76e/0x860 mm/swap.c:1039 folio_batch_release include/linux/pagevec.h:101 [inline] mapping_try_invalidate+0x3b1/0x4f0 mm/truncate.c:515 open_ctree+0xad5/0x2a10 fs/btrfs/disk-io.c:3241 btrfs_fill_super fs/btrfs/super.c:965 [inline] btrfs_get_tree_super fs/btrfs/super.c:1888 [inline] btrfs_get_tree+0xe7a/0x1920 fs/btrfs/super.c:2114 vfs_get_tree+0x90/0x2b0 fs/super.c:1800 fc_mount+0x1b/0xb0 fs/namespace.c:1231 btrfs_get_tree_subvol fs/btrfs/super.c:2077 [inline] btrfs_get_tree+0x652/0x1920 fs/btrfs/super.c:2115 vfs_get_tree+0x90/0x2b0 fs/super.c:1800 do_new_mount+0x2be/0xb40 fs/namespace.c:3472 do_mount fs/namespace.c:3812 [inline] __do_sys_mount fs/namespace.c:4020 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888032afb700: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff888032afb780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888032afb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ^ ffff888032afb880: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff888032afb900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================