================================================================== BUG: KASAN: slab-out-of-bounds in iov_iter_revert+0x1c1/0x590 lib/iov_iter.c:633 Read of size 4 at addr ffff8880282f0058 by task kworker/u8:11/3528 CPU: 1 UID: 0 PID: 3528 Comm: kworker/u8:11 Not tainted 6.13.0-syzkaller-07644-gc2da8b3f914f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 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:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 iov_iter_revert+0x1c1/0x590 lib/iov_iter.c:633 netfs_retry_write_stream fs/netfs/write_retry.c:44 [inline] netfs_retry_writes+0x17db/0x19b0 fs/netfs/write_retry.c:229 netfs_collect_write_results fs/netfs/write_collect.c:352 [inline] netfs_write_collection_worker+0x2f90/0x3bb0 fs/netfs/write_collect.c:374 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xa68/0x1840 kernel/workqueue.c:3317 worker_thread+0x870/0xd30 kernel/workqueue.c:3398 kthread+0x7ab/0x920 kernel/kthread.c:464 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 11915: 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+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_noprof+0x285/0x4c0 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] tomoyo_encode2 security/tomoyo/realpath.c:45 [inline] tomoyo_encode+0x26f/0x540 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x59e/0x5e0 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x258/0x4f0 security/tomoyo/file.c:771 security_file_open+0xac/0x250 security/security.c:3114 do_dentry_open+0x320/0x1960 fs/open.c:932 vfs_open+0x3b/0x370 fs/open.c:1085 do_open fs/namei.c:3828 [inline] path_openat+0x2c74/0x3580 fs/namei.c:3987 do_filp_open+0x27f/0x4e0 fs/namei.c:4014 do_sys_openat2+0x13e/0x1d0 fs/open.c:1427 do_sys_open fs/open.c:1442 [inline] __do_sys_creat fs/open.c:1520 [inline] __se_sys_creat fs/open.c:1514 [inline] __x64_sys_creat+0x123/0x170 fs/open.c:1514 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 11915: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x196/0x430 mm/slub.c:4761 tomoyo_check_open_permission+0x35f/0x4f0 security/tomoyo/file.c:786 security_file_open+0xac/0x250 security/security.c:3114 do_dentry_open+0x320/0x1960 fs/open.c:932 vfs_open+0x3b/0x370 fs/open.c:1085 do_open fs/namei.c:3828 [inline] path_openat+0x2c74/0x3580 fs/namei.c:3987 do_filp_open+0x27f/0x4e0 fs/namei.c:4014 do_sys_openat2+0x13e/0x1d0 fs/open.c:1427 do_sys_open fs/open.c:1442 [inline] __do_sys_creat fs/open.c:1520 [inline] __se_sys_creat fs/open.c:1514 [inline] __x64_sys_creat+0x123/0x170 fs/open.c:1514 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880282f0040 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 8 bytes to the right of allocated 16-byte region [ffff8880282f0040, ffff8880282f0050) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880282f0000 pfn:0x282f0 flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff88801ac41640 ffffea0000bd5250 ffffea0000be3890 raw: ffff8880282f0000 0000000000800074 00000001f5000000 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 5837, tgid 5837 (syz-executor), ts 235349783919, free_ts 235303621451 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_slab_page+0x59/0x110 mm/slub.c:2425 allocate_slab+0x5a/0x2b0 mm/slub.c:2589 new_slab mm/slub.c:2642 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3830 __slab_alloc+0x58/0xa0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_node_noprof+0x2ee/0x4d0 mm/slub.c:4304 __kvmalloc_node_noprof+0x72/0x190 mm/util.c:645 xt_jumpstack_alloc net/netfilter/x_tables.c:1355 [inline] xt_replace_table+0x1a2/0x780 net/netfilter/x_tables.c:1394 __do_replace+0x1ae/0xa50 net/ipv6/netfilter/ip6_tables.c:1081 do_replace net/ipv6/netfilter/ip6_tables.c:1158 [inline] do_ip6t_set_ctl+0xf11/0x1270 net/ipv6/netfilter/ip6_tables.c:1644 nf_setsockopt+0x297/0x2c0 net/netfilter/nf_sockopt.c:101 do_sock_setsockopt+0x3b1/0x720 net/socket.c:2298 __sys_setsockopt net/socket.c:2323 [inline] __do_sys_setsockopt net/socket.c:2329 [inline] __se_sys_setsockopt net/socket.c:2326 [inline] __x64_sys_setsockopt+0x1ee/0x280 net/socket.c:2326 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 page last free pid 7771 tgid 7771 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0xd3f/0x1010 mm/page_alloc.c:2659 tlb_batch_list_free mm/mmu_gather.c:159 [inline] tlb_finish_mmu+0x11f/0x200 mm/mmu_gather.c:468 exit_mmap+0x4d5/0xca0 mm/mmap.c:1685 __mmput+0x115/0x420 kernel/fork.c:1345 exit_mm+0x220/0x310 kernel/exit.c:570 do_exit+0x9ad/0x28e0 kernel/exit.c:925 do_group_exit+0x207/0x2c0 kernel/exit.c:1087 __do_sys_exit_group kernel/exit.c:1098 [inline] __se_sys_exit_group kernel/exit.c:1096 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1096 x64_sys_call+0x26a8/0x26b0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880282eff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880282eff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880282f0000: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc ^ ffff8880282f0080: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ffff8880282f0100: 00 00 fc fc 00 00 fc fc 00 00 fc fc 00 00 fc fc ==================================================================