hfsplus: request for non-existent node 16777216 in B*Tree hfsplus: request for non-existent node 16777216 in B*Tree ================================================================== BUG: KASAN: slab-out-of-bounds in memcpy_from_iter lib/iov_iter.c:73 [inline] BUG: KASAN: slab-out-of-bounds in iterate_bvec include/linux/iov_iter.h:122 [inline] BUG: KASAN: slab-out-of-bounds in iterate_and_advance2 include/linux/iov_iter.h:249 [inline] BUG: KASAN: slab-out-of-bounds in iterate_and_advance include/linux/iov_iter.h:271 [inline] BUG: KASAN: slab-out-of-bounds in __copy_from_iter lib/iov_iter.c:268 [inline] BUG: KASAN: slab-out-of-bounds in copy_page_from_iter_atomic+0x9b4/0x1e80 lib/iov_iter.c:500 Read of size 2048 at addr ffff888020354400 by task kworker/u4:8/2819 CPU: 0 PID: 2819 Comm: kworker/u4:8 Not tainted 6.7.0-rc1-syzkaller-00019-gc42d9eeef8e5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Workqueue: loop3 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x142/0x170 mm/kasan/report.c:588 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:187 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 memcpy_from_iter lib/iov_iter.c:73 [inline] iterate_bvec include/linux/iov_iter.h:122 [inline] iterate_and_advance2 include/linux/iov_iter.h:249 [inline] iterate_and_advance include/linux/iov_iter.h:271 [inline] __copy_from_iter lib/iov_iter.c:268 [inline] copy_page_from_iter_atomic+0x9b4/0x1e80 lib/iov_iter.c:500 generic_perform_write+0x392/0x630 mm/filemap.c:3926 shmem_file_write_iter+0xfc/0x120 mm/shmem.c:2878 do_iter_readv_writev+0x330/0x4a0 do_iter_write+0x1f6/0x8d0 fs/read_write.c:860 lo_write_bvec drivers/block/loop.c:249 [inline] lo_write_simple drivers/block/loop.c:271 [inline] do_req_filebacked drivers/block/loop.c:495 [inline] loop_handle_cmd drivers/block/loop.c:1915 [inline] loop_process_work+0x14c5/0x22a0 drivers/block/loop.c:1950 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1420 kernel/workqueue.c:2703 worker_thread+0xa5f/0x1000 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Allocated by task 11148: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc+0xb3/0x1a0 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] hfsplus_read_wrapper+0x545/0x1330 fs/hfsplus/wrapper.c:178 hfsplus_fill_super+0x38e/0x1c90 fs/hfsplus/super.c:413 mount_bdev+0x237/0x300 fs/super.c:1650 legacy_get_tree+0xef/0x190 fs/fs_context.c:662 vfs_get_tree+0x8c/0x2a0 fs/super.c:1771 do_new_mount+0x28f/0xae0 fs/namespace.c:3337 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3863 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xad/0xc0 mm/kasan/generic.c:492 insert_work+0x3e/0x330 kernel/workqueue.c:1647 __queue_work+0xc0c/0x1020 kernel/workqueue.c:1799 call_timer_fn+0x17a/0x5f0 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x67a/0x860 kernel/time/timer.c:2022 run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2035 __do_softirq+0x2b8/0x939 kernel/softirq.c:553 The buggy address belongs to the object at ffff888020354400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of allocated 512-byte region [ffff888020354400, ffff888020354600) The buggy address belongs to the physical page: page:ffffea000080d500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20354 head:ffffea000080d500 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012c41c80 0000000000000000 dead000000000001 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 10077466214, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0x33ea/0x3570 mm/page_alloc.c:3312 __alloc_pages+0x255/0x680 mm/page_alloc.c:4568 alloc_pages_mpol+0x3de/0x640 mm/mempolicy.c:2133 alloc_slab_page+0x6a/0x170 mm/slub.c:1870 allocate_slab mm/slub.c:2017 [inline] new_slab+0x84/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc8a/0x1330 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x21d/0x300 mm/slub.c:3517 kmalloc_trace+0x2a/0x60 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] device_private_init drivers/base/core.c:3470 [inline] device_add+0xc4/0xc90 drivers/base/core.c:3521 usb_add_gadget+0x38b/0x6a0 drivers/usb/gadget/udc/core.c:1405 usb_add_gadget_udc_release drivers/usb/gadget/udc/core.c:1460 [inline] usb_add_gadget_udc+0x14c/0x180 drivers/usb/gadget/udc/core.c:1507 dummy_udc_probe+0x6d4/0x7d0 drivers/usb/gadget/udc/dummy_hcd.c:1095 platform_probe+0x135/0x1b0 drivers/base/platform.c:1404 really_probe+0x294/0xc30 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:800 page_owner free stack trace missing Memory state around the buggy address: ffff888020354500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888020354580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888020354600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888020354680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888020354700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================