================================================================== BUG: KASAN: slab-out-of-bounds in iov_iter_revert+0x1c1/0x5a0 lib/iov_iter.c:633 Read of size 4 at addr ffff888040964bf8 by task kworker/u4:6/1034 CPU: 0 UID: 0 PID: 1034 Comm: kworker/u4:6 Not tainted 6.15.0-rc1-syzkaller-00025-gbec7dcbc242c #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: events_unbound netfs_write_collection_worker Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 iov_iter_revert+0x1c1/0x5a0 lib/iov_iter.c:633 netfs_retry_write_stream fs/netfs/write_retry.c:44 [inline] netfs_retry_writes+0x17f2/0x19d0 fs/netfs/write_retry.c:231 netfs_collect_write_results fs/netfs/write_collect.c:352 [inline] netfs_write_collection_worker+0x2fc0/0x3bf0 fs/netfs/write_collect.c:374 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac3/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd50 kernel/workqueue.c:3400 kthread+0x7b7/0x940 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5326: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x9d/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x236/0x370 mm/slub.c:4362 kmalloc_noprof include/linux/slab.h:905 [inline] slab_free_hook mm/slub.c:2341 [inline] slab_free mm/slub.c:4646 [inline] kmem_cache_free+0x16e/0x410 mm/slub.c:4748 p9_req_put+0x19c/0x1f0 net/9p/client.c:409 p9_client_write+0x411/0x850 net/9p/client.c:1674 v9fs_issue_write+0xf1/0x1d0 fs/9p/vfs_addr.c:59 netfs_do_issue_write fs/netfs/write_issue.c:239 [inline] netfs_issue_write fs/netfs/write_issue.c:269 [inline] netfs_end_issue_write+0x18d/0x420 fs/netfs/write_issue.c:541 netfs_unbuffered_write+0x5c0/0x630 fs/netfs/write_issue.c:733 netfs_unbuffered_write_iter_locked+0x456/0x9f0 fs/netfs/direct_write.c:100 netfs_unbuffered_write_iter+0x4e2/0x6a0 fs/netfs/direct_write.c:195 do_iter_readv_writev+0x71f/0x9d0 fs/read_write.c:-1 vfs_writev+0x38d/0xbc0 fs/read_write.c:1055 do_pwritev fs/read_write.c:1151 [inline] __do_sys_pwritev2 fs/read_write.c:1209 [inline] __se_sys_pwritev2+0x1b8/0x2d0 fs/read_write.c:1200 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 kasan_record_aux_stack+0xbf/0xd0 mm/kasan/generic.c:548 __call_rcu_common kernel/rcu/tree.c:3082 [inline] call_rcu+0x172/0xad0 kernel/rcu/tree.c:3202 slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4646 [inline] kmem_cache_free+0x312/0x410 mm/slub.c:4748 p9_req_put+0x19c/0x1f0 net/9p/client.c:409 p9_client_write+0x411/0x850 net/9p/client.c:1674 v9fs_issue_write+0xf1/0x1d0 fs/9p/vfs_addr.c:59 netfs_do_issue_write fs/netfs/write_issue.c:239 [inline] netfs_issue_write fs/netfs/write_issue.c:269 [inline] netfs_end_issue_write+0x18d/0x420 fs/netfs/write_issue.c:541 netfs_unbuffered_write+0x5c0/0x630 fs/netfs/write_issue.c:733 netfs_unbuffered_write_iter_locked+0x456/0x9f0 fs/netfs/direct_write.c:100 netfs_unbuffered_write_iter+0x4e2/0x6a0 fs/netfs/direct_write.c:195 do_iter_readv_writev+0x71f/0x9d0 fs/read_write.c:-1 vfs_writev+0x38d/0xbc0 fs/read_write.c:1055 do_pwritev fs/read_write.c:1151 [inline] __do_sys_pwritev2 fs/read_write.c:1209 [inline] __se_sys_pwritev2+0x1b8/0x2d0 fs/read_write.c:1200 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888040964bc0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 32 bytes to the right of allocated 24-byte region [ffff888040964bc0, ffff888040964bd8) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x40964 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801b041780 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080400040 00000000f5000000 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 0x52800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP), pid 5084, tgid 5084 (rm), ts 47260756646, free_ts 47232864334 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1717 prep_new_page mm/page_alloc.c:1725 [inline] get_page_from_freelist+0x352b/0x36c0 mm/page_alloc.c:3652 __alloc_frozen_pages_noprof+0x211/0x5b0 mm/page_alloc.c:4934 alloc_pages_mpol+0x339/0x690 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2459 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2623 new_slab mm/slub.c:2676 [inline] ___slab_alloc+0xc3b/0x1500 mm/slub.c:3862 __slab_alloc+0x58/0xa0 mm/slub.c:3952 __slab_alloc_node mm/slub.c:4027 [inline] slab_alloc_node mm/slub.c:4188 [inline] __kmalloc_cache_noprof+0x26a/0x370 mm/slub.c:4357 kmalloc_noprof include/linux/slab.h:905 [inline] slab_free_hook mm/slub.c:2341 [inline] slab_free mm/slub.c:4646 [inline] kmem_cache_free+0x16e/0x410 mm/slub.c:4748 anon_vma_free mm/rmap.c:137 [inline] __put_anon_vma+0x128/0x2d0 mm/rmap.c:2756 put_anon_vma include/linux/rmap.h:117 [inline] unlink_anon_vmas+0x492/0x5f0 mm/rmap.c:444 free_pgtables+0x44e/0x6f0 mm/memory.c:391 exit_mmap+0x5a9/0xde0 mm/mmap.c:1295 __mmput+0x115/0x420 kernel/fork.c:1379 exit_mm+0x221/0x310 kernel/exit.c:589 do_exit+0x994/0x27f0 kernel/exit.c:940 page last free pid 15 tgid 15 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0xde8/0x10a0 mm/page_alloc.c:2680 rcu_do_batch kernel/rcu/tree.c:2568 [inline] rcu_core+0xaac/0x17a0 kernel/rcu/tree.c:2824 handle_softirqs+0x2d6/0x9b0 kernel/softirq.c:579 run_ksoftirqd+0xcf/0x130 kernel/softirq.c:968 smpboot_thread_fn+0x576/0xaa0 kernel/smpboot.c:164 kthread+0x7b7/0x940 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888040964a80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc ffff888040964b00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc >ffff888040964b80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc ^ ffff888040964c00: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ffff888040964c80: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ==================================================================