================================================================== BUG: KASAN: slab-out-of-bounds in iov_iter_revert+0x1c1/0x5a0 lib/iov_iter.c:633 Read of size 4 at addr ffff888029ee7cf8 by task kworker/u8:16/8647 CPU: 1 UID: 0 PID: 8647 Comm: kworker/u8:16 Not tainted 6.15.0-rc2-syzkaller-00257-gb5c6891b2c5b #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+0xac5/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd50 kernel/workqueue.c:3400 kthread+0x7b9/0x940 kernel/kthread.c:464 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 11993: 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:4341 [inline] __kmalloc_node_track_caller_noprof+0x295/0x4d0 mm/slub.c:4360 __kmemdup_nul mm/util.c:63 [inline] kstrdup+0x42/0x100 mm/util.c:83 __kernfs_new_node+0xa2/0x890 fs/kernfs/dir.c:633 kernfs_new_node+0x114/0x220 fs/kernfs/dir.c:713 kernfs_create_dir_ns+0x43/0x120 fs/kernfs/dir.c:1081 sysfs_create_dir_ns+0x1a2/0x3f0 fs/sysfs/dir.c:59 create_dir lib/kobject.c:73 [inline] kobject_add_internal+0x435/0x8d0 lib/kobject.c:240 kobject_add_varg lib/kobject.c:374 [inline] kobject_add+0x15b/0x230 lib/kobject.c:426 device_add+0x4e5/0xbf0 drivers/base/core.c:3604 netdev_register_kobject+0x157/0x2f0 net/core/net-sysfs.c:2336 register_netdevice+0x12b0/0x1b80 net/core/dev.c:11009 veth_newlink+0x4c3/0xb80 drivers/net/veth.c:1818 rtnl_newlink_create+0x39d/0xcb0 net/core/rtnetlink.c:3833 __rtnl_newlink net/core/rtnetlink.c:3950 [inline] rtnl_newlink+0x18b0/0x1fe0 net/core/rtnetlink.c:4065 rtnetlink_rcv_msg+0x811/0xd70 net/core/rtnetlink.c:6955 netlink_rcv_skb+0x20a/0x480 net/netlink/af_netlink.c:2534 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline] netlink_unicast+0x7fa/0x9a0 net/netlink/af_netlink.c:1339 netlink_sendmsg+0x8c3/0xcd0 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x223/0x270 net/socket.c:727 __sys_sendto+0x365/0x4c0 net/socket.c:2180 __do_sys_sendto net/socket.c:2187 [inline] __se_sys_sendto net/socket.c:2183 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2183 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888029ee7ce0 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 10 bytes to the right of allocated 14-byte region [ffff888029ee7ce0, ffff888029ee7cee) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888029ee7200 pfn:0x29ee7 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801b041640 ffffea0000bd67c0 dead000000000002 raw: ffff888029ee7200 0000000000800079 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 9179, tgid 9179 (syz-executor), ts 326722744915, free_ts 326184548875 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x360a/0x37a0 mm/page_alloc.c:3700 __alloc_frozen_pages_noprof+0x211/0x5b0 mm/page_alloc.c:4982 alloc_slab_page mm/slub.c:2470 [inline] allocate_slab+0x66/0x3b0 mm/slub.c:2632 new_slab mm/slub.c:2686 [inline] ___slab_alloc+0xc3b/0x1500 mm/slub.c:3872 __slab_alloc+0x58/0xa0 mm/slub.c:3962 __slab_alloc_node mm/slub.c:4037 [inline] slab_alloc_node mm/slub.c:4198 [inline] __do_kmalloc_node mm/slub.c:4340 [inline] __kvmalloc_node_noprof+0x3f4/0x5a0 mm/slub.c:5026 xt_jumpstack_alloc net/netfilter/x_tables.c:1355 [inline] xt_replace_table+0x1a2/0x780 net/netfilter/x_tables.c:1394 __do_replace+0x1b0/0xa70 net/ipv6/netfilter/ip6_tables.c:1081 do_replace net/ipv6/netfilter/ip6_tables.c:1158 [inline] do_ip6t_set_ctl+0xc9c/0x1190 net/ipv6/netfilter/ip6_tables.c:1644 nf_setsockopt+0x297/0x2c0 net/netfilter/nf_sockopt.c:101 do_sock_setsockopt+0x3b3/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+0x187/0x210 net/socket.c:2324 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 9179 tgid 9179 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:2725 pagetable_free include/linux/mm.h:3002 [inline] pagetable_dtor_free include/linux/mm.h:3100 [inline] __tlb_remove_table+0x36b/0x460 include/asm-generic/tlb.h:215 __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x79/0xf0 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2568 [inline] rcu_core+0xaae/0x17a0 kernel/rcu/tree.c:2824 handle_softirqs+0x2d8/0x9b0 kernel/softirq.c:579 do_softirq+0x11f/0x1e0 kernel/softirq.c:480 __local_bh_enable_ip+0x1be/0x200 kernel/softirq.c:407 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:910 [inline] __dev_queue_xmit+0x1780/0x3f60 net/core/dev.c:4656 dev_queue_xmit include/linux/netdevice.h:3350 [inline] __netlink_deliver_tap_skb net/netlink/af_netlink.c:307 [inline] __netlink_deliver_tap+0x561/0x7f0 net/netlink/af_netlink.c:325 netlink_deliver_tap+0x19d/0x1b0 net/netlink/af_netlink.c:338 netlink_deliver_tap_kernel net/netlink/af_netlink.c:347 [inline] netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x7c6/0x9a0 net/netlink/af_netlink.c:1339 netlink_sendmsg+0x8c3/0xcd0 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x223/0x270 net/socket.c:727 __sys_sendto+0x365/0x4c0 net/socket.c:2180 __do_sys_sendto net/socket.c:2187 [inline] __se_sys_sendto net/socket.c:2183 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2183 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 Memory state around the buggy address: ffff888029ee7b80: 00 00 fc fc fa fb fc fc fa fb fc fc 00 00 fc fc ffff888029ee7c00: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc >ffff888029ee7c80: 00 00 fc fc fa fb fc fc 00 00 fc fc 00 06 fc fc ^ ffff888029ee7d00: 00 00 fc fc fa fb fc fc 00 05 fc fc 00 00 fc fc ffff888029ee7d80: 00 00 fc fc 00 00 fc fc fa fb fc fc 00 00 fc fc ==================================================================