================================================================== BUG: KASAN: slab-out-of-bounds in iov_iter_revert+0x1c1/0x5a0 lib/iov_iter.c:633 Read of size 4 at addr ffff88802179c5f8 by task kworker/u8:9/6041 CPU: 1 UID: 0 PID: 6041 Comm: kworker/u8:9 Not tainted 6.14.0-syzkaller-11270-g08733088b566 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 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 6655: 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] __do_kmalloc_node mm/slub.c:4318 [inline] __kmalloc_node_noprof+0x29a/0x4d0 mm/slub.c:4324 kmalloc_array_node_noprof include/linux/slab.h:1017 [inline] alloc_slab_obj_exts+0x3a/0xa0 mm/slub.c:1987 __memcg_slab_post_alloc_hook+0x31c/0x7e0 mm/memcontrol.c:3025 memcg_slab_post_alloc_hook mm/slub.c:2175 [inline] slab_post_alloc_hook mm/slub.c:4148 [inline] slab_alloc_node mm/slub.c:4187 [inline] __do_kmalloc_node mm/slub.c:4317 [inline] __kmalloc_node_track_caller_noprof+0x30e/0x4d0 mm/slub.c:4337 kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:599 __alloc_skb+0x1f2/0x480 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1340 [inline] alloc_skb_with_frags+0xc3/0x830 net/core/skbuff.c:6639 sock_alloc_send_pskb+0x91c/0xa70 net/core/sock.c:2949 unix_dgram_sendmsg+0x6d4/0x1ea0 net/unix/af_unix.c:2007 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:727 ____sys_sendmsg+0x523/0x860 net/socket.c:2566 ___sys_sendmsg net/socket.c:2620 [inline] __sys_sendmmsg+0x3a0/0x7b0 net/socket.c:2709 __do_sys_sendmmsg net/socket.c:2736 [inline] __se_sys_sendmmsg net/socket.c:2733 [inline] __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2733 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 ffff88802179c500 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 120 bytes to the right of allocated 128-byte region [ffff88802179c500, ffff88802179c580) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802179cc00 pfn:0x2179c flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff88801b041a00 ffffea00008ceed0 ffffea0000c45b10 raw: ffff88802179cc00 000000000010000d 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 6036, tgid 6033 (syz.1.28), ts 111472634085, free_ts 111253665119 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1585 prep_new_page mm/page_alloc.c:1593 [inline] get_page_from_freelist+0x3ab2/0x3c50 mm/page_alloc.c:3538 __alloc_frozen_pages_noprof+0x266/0x580 mm/page_alloc.c:4806 alloc_pages_mpol+0x339/0x690 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2446 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2610 new_slab mm/slub.c:2663 [inline] ___slab_alloc+0xc3b/0x1500 mm/slub.c:3849 __slab_alloc+0x58/0xa0 mm/slub.c:3939 __slab_alloc_node mm/slub.c:4014 [inline] slab_alloc_node mm/slub.c:4175 [inline] __kmalloc_cache_noprof+0x26a/0x370 mm/slub.c:4344 kmalloc_noprof include/linux/slab.h:902 [inline] kzalloc_noprof include/linux/slab.h:1036 [inline] tipc_publ_create net/tipc/name_table.c:233 [inline] tipc_nametbl_insert_publ+0x64/0x1510 net/tipc/name_table.c:484 tipc_nametbl_publish+0xc7/0x1e0 net/tipc/name_table.c:776 tipc_sk_publish+0x200/0x4b0 net/tipc/socket.c:2915 tipc_sk_join+0x42f/0x8a0 net/tipc/socket.c:3093 tipc_setsockopt+0x914/0xc40 net/tipc/socket.c:3200 do_sock_setsockopt+0x3b1/0x710 net/socket.c:2296 __sys_setsockopt net/socket.c:2321 [inline] __do_sys_setsockopt net/socket.c:2327 [inline] __se_sys_setsockopt net/socket.c:2324 [inline] __x64_sys_setsockopt+0x1ee/0x280 net/socket.c:2324 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 page last free pid 6036 tgid 6033 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1130 [inline] __free_frozen_pages+0xd7c/0x1020 mm/page_alloc.c:2707 vfree+0x1c3/0x360 mm/vmalloc.c:3383 bpf_prog_calc_tag+0x67f/0x8e0 kernel/bpf/core.c:359 resolve_pseudo_ldimm64+0xd3/0xd30 kernel/bpf/verifier.c:20086 bpf_check+0x1d0b/0x1d1c0 kernel/bpf/verifier.c:24007 bpf_prog_load+0x17ee/0x2250 kernel/bpf/syscall.c:2971 __sys_bpf+0x5dd/0x8b0 kernel/bpf/syscall.c:5834 __do_sys_bpf kernel/bpf/syscall.c:5941 [inline] __se_sys_bpf kernel/bpf/syscall.c:5939 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5939 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 Memory state around the buggy address: ffff88802179c480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802179c500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802179c580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802179c600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc ffff88802179c680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================