================================================================== BUG: KASAN: slab-out-of-bounds in iov_iter_revert+0x1c1/0x5a0 lib/iov_iter.c:633 Read of size 4 at addr ffff8880317e4e58 by task kworker/u8:16/8077 CPU: 1 UID: 0 PID: 8077 Comm: kworker/u8:16 Not tainted 6.15.0-rc1-next-20250411-syzkaller #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 6287: 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:4331 [inline] __kmalloc_node_track_caller_noprof+0x295/0x4d0 mm/slub.c:4350 __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:11062 br_add_bridge+0x9f/0xe0 net/bridge/br_if.c:469 br_ioctl_stub+0x5c2/0xdd0 net/bridge/br_ioctl.c:442 br_ioctl_call net/socket.c:1163 [inline] sock_ioctl+0x580/0x900 net/socket.c:1265 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:892 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 ffff8880317e4e40 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 13 bytes to the right of allocated 11-byte region [ffff8880317e4e40, ffff8880317e4e4b) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x317e4 anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801b041640 0000000000000000 dead000000000001 raw: 0000000000000000 0000000080800080 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 5835, tgid 5835 (syz-executor), ts 114518034954, free_ts 114425062065 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:2461 [inline] allocate_slab+0x66/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] __do_kmalloc_node mm/slub.c:4330 [inline] __kvmalloc_node_noprof+0x3f4/0x5a0 mm/slub.c:5018 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+0xf18/0x1270 net/ipv6/netfilter/ip6_tables.c:1644 nf_setsockopt+0x295/0x2c0 net/netfilter/nf_sockopt.c:101 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+0x1ea/0x270 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 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 6037 tgid 6032 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 rcu_do_batch kernel/rcu/tree.c:2546 [inline] rcu_core+0xaac/0x17a0 kernel/rcu/tree.c:2802 handle_softirqs+0x2d6/0x9b0 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0xfb/0x220 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Memory state around the buggy address: ffff8880317e4d00: 00 00 fc fc fa fb fc fc 00 06 fc fc 00 01 fc fc ffff8880317e4d80: 00 00 fc fc 00 00 fc fc fa fb fc fc 00 00 fc fc >ffff8880317e4e00: 00 03 fc fc 00 03 fc fc 00 03 fc fc 00 00 fc fc ^ ffff8880317e4e80: fa fb fc fc 00 00 fc fc 00 00 fc fc fa fb fc fc ffff8880317e4f00: 00 00 fc fc 00 00 fc fc fa fb fc fc fa fb fc fc ==================================================================