================================================================== BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:641 [inline] BUG: KASAN: use-after-free in string+0x20f/0x2a0 lib/vsprintf.c:723 Read of size 1 at addr ffff8881049eb730 by task syz.4.849/4263 CPU: 1 PID: 4263 Comm: syz.4.849 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x1a7/0x208 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x100/0x140 mm/kasan/report.c:452 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 string_nocheck lib/vsprintf.c:641 [inline] string+0x20f/0x2a0 lib/vsprintf.c:723 vsnprintf+0xec5/0x1990 lib/vsprintf.c:2689 seq_vprintf fs/seq_file.c:398 [inline] seq_printf+0x185/0x280 fs/seq_file.c:413 show_interrupts+0x921/0xa90 kernel/irq/proc.c:526 seq_read_iter+0x908/0xce0 fs/seq_file.c:272 proc_reg_read_iter+0x1be/0x290 fs/proc/inode.c:310 call_read_iter include/linux/fs.h:2066 [inline] new_sync_read fs/read_write.c:415 [inline] vfs_read+0x62a/0xa50 fs/read_write.c:496 ksys_read+0x14a/0x260 fs/read_write.c:634 __do_sys_read fs/read_write.c:644 [inline] __se_sys_read fs/read_write.c:642 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:642 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f86b795e159 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f86b63b7028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007f86b7be5fa0 RCX: 00007f86b795e159 RDX: 00000000000000bd RSI: 0000200000006a00 RDI: 0000000000000004 RBP: 00007f86b79f506b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f86b7be6038 R14: 00007f86b7be5fa0 R15: 00007ffec5747838 Allocated by task 1777: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc mm/kasan/common.c:509 [inline] __kasan_kmalloc+0xd4/0x100 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] __kmalloc+0x19f/0x330 mm/slub.c:4038 __kmalloc_node include/linux/slab.h:421 [inline] kmalloc_node include/linux/slab.h:578 [inline] __vmalloc_area_node mm/vmalloc.c:2520 [inline] __vmalloc_node_range+0x294/0x7a0 mm/vmalloc.c:2629 __vmalloc_node mm/vmalloc.c:2689 [inline] vzalloc+0x78/0x90 mm/vmalloc.c:2742 xt_counters_alloc+0x44/0x50 net/netfilter/x_tables.c:1367 __do_replace+0xa8/0x9f0 net/ipv6/netfilter/ip6_tables.c:1063 do_replace net/ipv6/netfilter/ip6_tables.c:1158 [inline] do_ip6t_set_ctl+0xa98/0xd80 net/ipv6/netfilter/ip6_tables.c:1643 nf_setsockopt+0x272/0x2a0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x2568/0x36f0 net/ipv6/ipv6_sockglue.c:1014 tcp_setsockopt+0x22b/0x1d80 net/ipv4/tcp.c:3500 sock_common_setsockopt+0xa0/0xb0 net/core/sock.c:3326 __sys_setsockopt+0x2fa/0x480 net/socket.c:2147 __do_sys_setsockopt net/socket.c:2158 [inline] __se_sys_setsockopt net/socket.c:2155 [inline] __x64_sys_setsockopt+0xbf/0xd0 net/socket.c:2155 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 704: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1600 [inline] slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1626 slab_free mm/slub.c:3208 [inline] kfree+0xc0/0x270 mm/slub.c:4196 kfree_const+0x39/0x40 mm/util.c:43 kernfs_put+0x1be/0x480 fs/kernfs/dir.c:538 kernfs_remove_by_name_ns+0xea/0x160 fs/kernfs/dir.c:1599 kernfs_remove_by_name include/linux/kernfs.h:623 [inline] sysfs_remove_link+0x50/0x60 fs/sysfs/symlink.c:152 driver_sysfs_remove drivers/base/dd.c:440 [inline] __device_release_driver drivers/base/dd.c:1173 [inline] device_release_driver_internal+0x3ba/0x7c0 drivers/base/dd.c:1221 device_release_driver+0x19/0x20 drivers/base/dd.c:1244 bus_remove_device+0x2df/0x340 drivers/base/bus.c:535 device_del+0x62e/0xe60 drivers/base/core.c:3453 usb_disconnect+0x55e/0x870 drivers/usb/core/hub.c:2341 hub_port_connect drivers/usb/core/hub.c:5343 [inline] hub_port_connect_change drivers/usb/core/hub.c:5644 [inline] port_event drivers/usb/core/hub.c:5810 [inline] hub_event+0x19c2/0x4220 drivers/usb/core/hub.c:5892 process_one_work+0x6fd/0xbc0 kernel/workqueue.c:2301 process_scheduled_works kernel/workqueue.c:2363 [inline] worker_thread+0xd1c/0x13c0 kernel/workqueue.c:2449 kthread+0x324/0x3b0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff8881049eb730 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [ffff8881049eb730, ffff8881049eb738) The buggy address belongs to the page: page:ffffea0004127ac0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1049eb flags: 0x4000000000000200(slab) raw: 4000000000000200 ffffea0004678300 0000000900000009 ffff888100043c80 raw: 0000000000000000 0000000000660066 00000001ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 16, ts 1621075729, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x176/0x190 mm/page_alloc.c:2462 get_page_from_freelist+0x225f/0x23f0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x29a/0x640 mm/page_alloc.c:5384 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1813 [inline] new_slab+0x84/0x3f0 mm/slub.c:1874 new_slab_objects mm/slub.c:2632 [inline] ___slab_alloc+0x2f8/0x4c0 mm/slub.c:2796 __slab_alloc+0x63/0xa0 mm/slub.c:2836 slab_alloc_node mm/slub.c:2918 [inline] slab_alloc mm/slub.c:2960 [inline] __kmalloc_track_caller+0x1e4/0x310 mm/slub.c:4541 kstrdup mm/util.c:63 [inline] kstrdup_const+0x55/0x90 mm/util.c:86 __kernfs_new_node+0xa6/0x670 fs/kernfs/dir.c:658 kernfs_new_node+0x150/0x260 fs/kernfs/dir.c:739 kernfs_create_dir_ns+0x47/0x130 fs/kernfs/dir.c:1087 sysfs_create_dir_ns+0x128/0x290 fs/sysfs/dir.c:59 create_dir lib/kobject.c:89 [inline] kobject_add_internal+0x774/0xde0 lib/kobject.c:263 kobject_add_varg lib/kobject.c:398 [inline] kobject_add+0x165/0x230 lib/kobject.c:450 device_add+0x3d8/0xc00 drivers/base/core.c:3206 device_create_groups_vargs drivers/base/core.c:3960 [inline] device_create+0x26c/0x300 drivers/base/core.c:4002 page_owner free stack trace missing Memory state around the buggy address: ffff8881049eb600: fc fc fc fa fc fc fc fc fa fc fc fc fc fa fc fc ffff8881049eb680: fc fc fa fc fc fc fc 00 fc fc fc fc fa fc fc fc >ffff8881049eb700: fc 00 fc fc fc fc fa fc fc fc fc 00 fc fc fc fc ^ ffff8881049eb780: fa fc fc fc fc 00 fc fc fc fc fa fc fc fc fc 00 ffff8881049eb800: fc fc fc fc fa fc fc fc fc fa fc fc fc fc 00 fc ==================================================================