================================================================== BUG: KASAN: slab-use-after-free in string_nocheck lib/vsprintf.c:653 [inline] BUG: KASAN: slab-use-after-free in string+0x231/0x2b0 lib/vsprintf.c:735 Read of size 1 at addr ffff88805657e820 by task udevd/5230 CPU: 1 UID: 0 PID: 5230 Comm: udevd Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 string_nocheck lib/vsprintf.c:653 [inline] string+0x231/0x2b0 lib/vsprintf.c:735 vsnprintf+0x739/0xf00 lib/vsprintf.c:2926 add_uevent_var+0x1cc/0x450 lib/kobject_uevent.c:679 ib_device_uevent+0x79/0xa0 drivers/infiniband/core/device.c:529 dev_uevent+0x48c/0x7a0 drivers/base/core.c:2700 uevent_show+0x19c/0x310 drivers/base/core.c:2756 dev_attr_show+0x55/0xc0 drivers/base/core.c:2421 sysfs_kf_seq_show+0x30d/0x490 fs/sysfs/file.c:65 seq_read_iter+0x4ea/0xe10 fs/seq_file.c:230 new_sync_read fs/read_write.c:491 [inline] vfs_read+0x557/0xa30 fs/read_write.c:572 ksys_read+0x145/0x250 fs/read_write.c:715 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f87174a7407 Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff RSP: 002b:00007fff893ff4d0 EFLAGS: 00000202 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007f8717bbf880 RCX: 00007f87174a7407 RDX: 0000000000001000 RSI: 000056318416beb0 RDI: 000000000000000c RBP: 00007f87175efff0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 000000000000000a R13: 00007f87175efea0 R14: 0000000000000000 R15: 00005631841875f0 Allocated by task 6164: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4365 [inline] __kmalloc_node_track_caller_noprof+0x271/0x4e0 mm/slub.c:4384 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x42/0x100 mm/util.c:84 kobject_set_name_vargs+0x61/0x110 lib/kobject.c:274 dev_set_name+0xd4/0x120 drivers/base/core.c:3492 assign_name drivers/infiniband/core/device.c:1248 [inline] ib_register_device+0x12c/0x1380 drivers/infiniband/core/device.c:1438 rxe_register_device+0x1ef/0x310 drivers/infiniband/sw/rxe/rxe_verbs.c:1556 rxe_net_add+0x81/0x110 drivers/infiniband/sw/rxe/rxe_net.c:550 rxe_newlink+0xdd/0x190 drivers/infiniband/sw/rxe/rxe.c:234 nldev_newlink+0x4a2/0x5a0 drivers/infiniband/core/nldev.c:1797 rdma_nl_rcv_msg drivers/infiniband/core/netlink.c:-1 [inline] rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline] rdma_nl_rcv+0x6ab/0x980 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82f/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x219/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668 __sys_sendmsg net/socket.c:2700 [inline] __do_sys_sendmsg net/socket.c:2705 [inline] __se_sys_sendmsg net/socket.c:2703 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6243: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x5b/0x80 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kfree+0x18e/0x440 mm/slub.c:4879 kobject_rename+0x38f/0x420 lib/kobject.c:524 device_rename+0x15d/0x1f0 drivers/base/core.c:4549 ib_device_rename+0x23d/0x660 drivers/infiniband/core/device.c:429 nldev_set_doit+0x29f/0x480 drivers/infiniband/core/nldev.c:1147 rdma_nl_rcv_msg drivers/infiniband/core/netlink.c:-1 [inline] rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline] rdma_nl_rcv+0x6ab/0x980 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82f/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x219/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668 __sys_sendmsg net/socket.c:2700 [inline] __do_sys_sendmsg net/socket.c:2705 [inline] __se_sys_sendmsg net/socket.c:2703 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88805657e820 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of freed 8-byte region [ffff88805657e820, ffff88805657e828) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5657e flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801a441500 ffffea000082e9c0 dead000000000002 raw: 0000000000000000 0000000000800080 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5858, tgid 5858 (syz-executor), ts 92709635939, free_ts 30697773467 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] __do_kmalloc_node mm/slub.c:4364 [inline] __kmalloc_node_track_caller_noprof+0x2f8/0x4e0 mm/slub.c:4384 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x42/0x100 mm/util.c:84 kobject_set_name_vargs+0x61/0x110 lib/kobject.c:274 dev_set_name+0xd4/0x120 drivers/base/core.c:3492 netdev_register_kobject+0xb7/0x310 net/core/net-sysfs.c:2342 register_netdevice+0x126c/0x1ae0 net/core/dev.c:11194 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1034 [inline] nsim_create+0xae8/0xf10 drivers/net/netdevsim/netdev.c:1105 __nsim_dev_port_add+0x6b6/0xb10 drivers/net/netdevsim/dev.c:1438 nsim_dev_port_add_all+0x37/0xf0 drivers/net/netdevsim/dev.c:1494 nsim_drv_probe+0x88e/0xba0 drivers/net/netdevsim/dev.c:1653 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 __free_pages mm/page_alloc.c:5260 [inline] free_contig_range+0x1bd/0x4a0 mm/page_alloc.c:7091 destroy_args+0x64/0x4a0 mm/debug_vm_pgtable.c:958 debug_vm_pgtable+0x39f/0x3b0 mm/debug_vm_pgtable.c:1340 do_one_initcall+0x233/0x820 init/main.c:1269 do_initcall_level+0x104/0x190 init/main.c:1331 do_initcalls+0x59/0xa0 init/main.c:1347 kernel_init_freeable+0x334/0x4b0 init/main.c:1579 kernel_init+0x1d/0x1d0 init/main.c:1469 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88805657e700: 04 fc fc fc 05 fc fc fc 05 fc fc fc 05 fc fc fc ffff88805657e780: 05 fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc >ffff88805657e800: 06 fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc ^ ffff88805657e880: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc ffff88805657e900: fa fc fc fc fa fc fc fc 05 fc fc fc 05 fc fc fc ==================================================================