hfsplus: b-tree write err: -5, ino 4 ================================================================== BUG: KASAN: slab-out-of-bounds in copy_page_from_iter_atomic+0x872/0x1120 lib/iov_iter.c:820 Read of size 1024 at addr ffff88805f116c00 by task kworker/u4:4/102 CPU: 0 PID: 102 Comm: kworker/u4:4 Not tainted 6.1.92-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: loop0 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 kasan_check_range+0x27f/0x290 mm/kasan/generic.c:189 memcpy+0x25/0x60 mm/kasan/shadow.c:65 copy_page_from_iter_atomic+0x872/0x1120 lib/iov_iter.c:820 generic_perform_write+0x36c/0x5e0 mm/filemap.c:3825 __generic_file_write_iter+0x176/0x400 mm/filemap.c:3945 generic_file_write_iter+0xab/0x310 mm/filemap.c:3977 do_iter_write+0x6e6/0xc50 fs/read_write.c:861 lo_write_bvec drivers/block/loop.c:247 [inline] lo_write_simple drivers/block/loop.c:269 [inline] do_req_filebacked drivers/block/loop.c:493 [inline] loop_handle_cmd drivers/block/loop.c:1909 [inline] loop_process_work+0x13ff/0x2200 drivers/block/loop.c:1944 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 13270: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0xb2/0x230 mm/slab_common.c:968 kmalloc include/linux/slab.h:561 [inline] hfsplus_read_wrapper+0x52c/0x1330 fs/hfsplus/wrapper.c:178 hfsplus_fill_super+0x38a/0x1c90 fs/hfsplus/super.c:413 mount_bdev+0x2c9/0x3f0 fs/super.c:1432 legacy_get_tree+0xeb/0x180 fs/fs_context.c:632 vfs_get_tree+0x88/0x270 fs/super.c:1562 do_new_mount+0x2ba/0xb40 fs/namespace.c:3051 do_mount fs/namespace.c:3394 [inline] __do_sys_mount fs/namespace.c:3602 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3579 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88805f116c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff88805f116c00, ffff88805f116e00) The buggy address belongs to the physical page: page:ffffea00017c4500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5f114 head:ffffea00017c4500 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888012441c80 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 0x1d28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 40, tgid 40 (kworker/u4:2), ts 937702320662, free_ts 927452272608 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513 prep_new_page mm/page_alloc.c:2520 [inline] get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5547 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc_node_track_caller+0xa0/0x220 mm/slab_common.c:975 kmalloc_reserve net/core/skbuff.c:446 [inline] pskb_expand_head+0x18c/0x10e0 net/core/skbuff.c:1848 netlink_trim+0x183/0x220 net/netlink/af_netlink.c:1308 netlink_broadcast+0x5b/0x10b0 net/netlink/af_netlink.c:1502 nlmsg_multicast include/net/netlink.h:1071 [inline] genlmsg_multicast_netns include/net/genetlink.h:333 [inline] genlmsg_multicast include/net/genetlink.h:348 [inline] hwsim_mcast_config_msg drivers/net/wireless/mac80211_hwsim.c:3197 [inline] hwsim_mcast_del_radio drivers/net/wireless/mac80211_hwsim.c:4669 [inline] mac80211_hwsim_del_radio+0x3e9/0x4a0 drivers/net/wireless/mac80211_hwsim.c:4681 hwsim_exit_net+0x5b8/0x660 drivers/net/wireless/mac80211_hwsim.c:5470 ops_exit_list net/core/net_namespace.c:172 [inline] cleanup_net+0x6ce/0xb60 net/core/net_namespace.c:604 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1440 [inline] free_pcp_prepare mm/page_alloc.c:1490 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3453 __vunmap+0x834/0x9a0 mm/vmalloc.c:2717 kcov_put kernel/kcov.c:428 [inline] kcov_close+0x27/0x50 kernel/kcov.c:524 __fput+0x3b7/0x890 fs/file_table.c:320 task_work_run+0x246/0x300 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa73/0x26a0 kernel/exit.c:869 do_group_exit+0x202/0x2b0 kernel/exit.c:1019 __do_sys_exit_group kernel/exit.c:1030 [inline] __se_sys_exit_group kernel/exit.c:1028 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1028 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff88805f116d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805f116d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805f116e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88805f116e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805f116f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================