================================================================== BUG: KASAN: slab-out-of-bounds in copy_page_from_iter_atomic+0x8e3/0x1230 lib/iov_iter.c:978 Read of size 2048 at addr ffff88807a1d8800 by task kworker/u4:2/154 CPU: 1 PID: 154 Comm: kworker/u4:2 Not tainted 5.15.172-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: loop0 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189 memcpy+0x25/0x60 mm/kasan/shadow.c:65 copy_page_from_iter_atomic+0x8e3/0x1230 lib/iov_iter.c:978 generic_perform_write+0x33a/0x5b0 mm/filemap.c:3793 __generic_file_write_iter+0x243/0x4f0 mm/filemap.c:3912 generic_file_write_iter+0xa7/0x1b0 mm/filemap.c:3944 do_iter_readv_writev+0x594/0x7a0 do_iter_write+0x1e6/0x760 fs/read_write.c:855 lo_write_bvec+0x297/0x740 drivers/block/loop.c:316 lo_write_simple drivers/block/loop.c:338 [inline] do_req_filebacked drivers/block/loop.c:656 [inline] loop_handle_cmd drivers/block/loop.c:2234 [inline] loop_process_work+0x2309/0x2af0 drivers/block/loop.c:2274 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 4988: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x168/0x300 mm/slub.c:4407 kmalloc include/linux/slab.h:596 [inline] hfsplus_read_wrapper+0x4e3/0x13b0 fs/hfsplus/wrapper.c:180 hfsplus_fill_super+0x38a/0x1c90 fs/hfsplus/super.c:413 mount_bdev+0x2c9/0x3f0 fs/super.c:1400 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x2ba/0xb40 fs/namespace.c:3012 do_mount fs/namespace.c:3355 [inline] __do_sys_mount fs/namespace.c:3563 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3540 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88807a1d8800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff88807a1d8800, ffff88807a1d8a00) The buggy address belongs to the page: page:ffffea0001e87600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a1d8 head:ffffea0001e87600 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 0000000500000001 ffff888017041c80 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 368, ts 80795079164, free_ts 80787192276 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192 __alloc_pages+0x272/0x700 mm/page_alloc.c:5464 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] __kmalloc_node_track_caller+0x1f6/0x390 mm/slub.c:4958 kmalloc_reserve net/core/skbuff.c:356 [inline] pskb_expand_head+0x111/0x1130 net/core/skbuff.c:1709 netlink_trim+0x183/0x220 net/netlink/af_netlink.c:1308 netlink_broadcast_filtered+0x62/0x11a0 net/netlink/af_netlink.c:1513 netlink_broadcast+0x35/0x50 net/netlink/af_netlink.c:1558 __devlink_port_type_set net/core/devlink.c:9163 [inline] devlink_port_type_eth_set+0x27e/0x3b0 net/core/devlink.c:9219 __nsim_dev_port_add+0x884/0xb90 drivers/net/netdevsim/dev.c:1325 nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1372 [inline] nsim_dev_reload_create drivers/net/netdevsim/dev.c:1421 [inline] nsim_dev_reload_up+0x6c9/0x970 drivers/net/netdevsim/dev.c:910 devlink_reload+0x31a/0x750 net/core/devlink.c:3970 devlink_pernet_pre_exit+0x1ca/0x350 net/core/devlink.c:11543 ops_pre_exit_list net/core/net_namespace.c:162 [inline] cleanup_net+0x59c/0xb60 net/core/net_namespace.c:587 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 stack_depot_save+0x3ef/0x440 lib/stackdepot.c:335 kasan_save_stack mm/kasan/common.c:40 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xd1/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] batadv_hardif_add_interface net/batman-adv/hard-interface.c:870 [inline] batadv_hard_if_event+0xe8d/0x17a0 net/batman-adv/hard-interface.c:958 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2018 [inline] call_netdevice_notifiers_extack net/core/dev.c:2030 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2044 register_netdevice+0x12e8/0x1720 net/core/dev.c:10396 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:317 [inline] nsim_create+0x329/0x3e0 drivers/net/netdevsim/netdev.c:365 __nsim_dev_port_add+0x6de/0xb90 drivers/net/netdevsim/dev.c:1312 nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1372 [inline] nsim_dev_reload_create drivers/net/netdevsim/dev.c:1421 [inline] nsim_dev_reload_up+0x6c9/0x970 drivers/net/netdevsim/dev.c:910 devlink_reload+0x31a/0x750 net/core/devlink.c:3970 devlink_pernet_pre_exit+0x1ca/0x350 net/core/devlink.c:11543 ops_pre_exit_list net/core/net_namespace.c:162 [inline] cleanup_net+0x59c/0xb60 net/core/net_namespace.c:587 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 Memory state around the buggy address: ffff88807a1d8900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807a1d8980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807a1d8a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807a1d8a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807a1d8b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================