================================================================== BUG: KASAN: slab-out-of-bounds in memcpy_from_iter lib/iov_iter.c:380 [inline] BUG: KASAN: slab-out-of-bounds in copy_page_from_iter_atomic+0x93b/0x1310 lib/iov_iter.c:581 Read of size 1024 at addr ffff8880464f5c00 by task kworker/u4:32/6950 CPU: 0 PID: 6950 Comm: kworker/u4:32 Not tainted 6.4.0-syzkaller-01554-g6f612579be9d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Workqueue: loop0 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:351 [inline] print_report+0x163/0x540 mm/kasan/report.c:462 kasan_report+0x176/0x1b0 mm/kasan/report.c:572 kasan_check_range+0x283/0x290 mm/kasan/generic.c:187 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 memcpy_from_iter lib/iov_iter.c:380 [inline] copy_page_from_iter_atomic+0x93b/0x1310 lib/iov_iter.c:581 generic_perform_write+0x370/0x5e0 mm/filemap.c:3954 __generic_file_write_iter+0x17a/0x400 mm/filemap.c:4074 generic_file_write_iter+0xaf/0x310 mm/filemap.c:4106 do_iter_write+0x84f/0xde0 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:1886 [inline] loop_process_work+0x144b/0x2220 drivers/block/loop.c:1921 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2408 worker_thread+0xa63/0x1210 kernel/workqueue.c:2555 kthread+0x2b8/0x350 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 13122: 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:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0xb9/0x230 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] hfsplus_read_wrapper+0x545/0x1330 fs/hfsplus/wrapper.c:178 hfsplus_fill_super+0x38e/0x1c90 fs/hfsplus/super.c:413 mount_bdev+0x276/0x3b0 fs/super.c:1392 legacy_get_tree+0xef/0x190 fs/fs_context.c:611 vfs_get_tree+0x8c/0x270 fs/super.c:1520 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 insert_work+0x54/0x3d0 kernel/workqueue.c:1368 __queue_work+0xb37/0xf10 kernel/workqueue.c:1529 call_timer_fn+0x178/0x580 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+0x2ab/0x908 kernel/softirq.c:553 Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 kvfree_call_rcu+0xf8/0x790 kernel/rcu/tree.c:3368 drop_sysctl_table+0x31c/0x460 fs/proc/proc_sysctl.c:1695 drop_sysctl_table+0x32e/0x460 fs/proc/proc_sysctl.c:1698 unregister_sysctl_table+0x8a/0x130 fs/proc/proc_sysctl.c:1733 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7118 [inline] addrconf_sysctl_unregister net/ipv6/addrconf.c:7146 [inline] addrconf_ifdown+0x1814/0x1b90 net/ipv6/addrconf.c:3908 addrconf_notify+0x1b1/0xfe0 notifier_call_chain+0x18c/0x3a0 kernel/notifier.c:93 call_netdevice_notifiers_info net/core/dev.c:1935 [inline] call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] unregister_netdevice_many_notify+0xddb/0x1890 net/core/dev.c:10884 unregister_netdevice_many net/core/dev.c:10940 [inline] unregister_netdevice_queue+0x2ee/0x360 net/core/dev.c:10820 unregister_netdevice include/linux/netdevice.h:3112 [inline] __tun_detach+0x6b4/0x15a0 drivers/net/tun.c:684 tun_detach drivers/net/tun.c:700 [inline] tun_chr_close+0x108/0x1b0 drivers/net/tun.c:3491 __fput+0x3f8/0x950 fs/file_table.c:378 task_work_run+0x24a/0x300 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xd9/0x100 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:297 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880464f5c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of allocated 512-byte region [ffff8880464f5c00, ffff8880464f5e00) The buggy address belongs to the physical page: page:ffffea0001193d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x464f4 head:ffffea0001193d00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012441c80 dead000000000100 dead000000000122 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 47, tgid 47 (kworker/u4:3), ts 87686910195, free_ts 12369782241 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1744 prep_new_page mm/page_alloc.c:1751 [inline] get_page_from_freelist+0x320e/0x3390 mm/page_alloc.c:3523 __alloc_pages+0x255/0x670 mm/page_alloc.c:4794 alloc_slab_page+0x6a/0x160 mm/slub.c:1872 allocate_slab mm/slub.c:2019 [inline] new_slab+0x84/0x2f0 mm/slub.c:2072 ___slab_alloc+0xade/0x1100 mm/slub.c:3225 __slab_alloc mm/slub.c:3324 [inline] __slab_alloc_node mm/slub.c:3377 [inline] slab_alloc_node mm/slub.c:3470 [inline] __kmem_cache_alloc_node+0x1af/0x270 mm/slub.c:3519 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] batadv_forw_packet_alloc+0x19c/0x3b0 net/batman-adv/send.c:519 batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:562 [inline] batadv_iv_ogm_queue_add+0x6d7/0xbe0 net/batman-adv/bat_iv_ogm.c:670 batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:833 [inline] batadv_iv_ogm_schedule+0x83b/0x1010 net/batman-adv/bat_iv_ogm.c:868 batadv_iv_send_outstanding_bat_ogm_packet+0x6fe/0x810 net/batman-adv/bat_iv_ogm.c:1712 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2408 worker_thread+0xa63/0x1210 kernel/workqueue.c:2555 kthread+0x2b8/0x350 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1308 [inline] free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2577 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2672 free_contig_range+0x9e/0x150 mm/page_alloc.c:7020 destroy_args+0x102/0x9a0 mm/debug_vm_pgtable.c:1023 debug_vm_pgtable+0x405/0x490 mm/debug_vm_pgtable.c:1403 do_one_initcall+0x23d/0x7d0 init/main.c:1239 do_initcall_level+0x157/0x210 init/main.c:1312 do_initcalls+0x3f/0x80 init/main.c:1328 kernel_init_freeable+0x43b/0x5d0 init/main.c:1564 kernel_init+0x1d/0x2a0 init/main.c:1455 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff8880464f5d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880464f5d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880464f5e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880464f5e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880464f5f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================