================================================================== BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:639 [inline] BUG: KASAN: use-after-free in string+0x231/0x2b0 lib/vsprintf.c:721 Read of size 1 at addr ffff888052f9ca20 by task syz.5.1308/10620 CPU: 0 UID: 0 PID: 10620 Comm: syz.5.1308 Not tainted 6.15.0-rc5-syzkaller-00300-g3ce9925823c7 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 string_nocheck lib/vsprintf.c:639 [inline] string+0x231/0x2b0 lib/vsprintf.c:721 vsnprintf+0x739/0xf00 lib/vsprintf.c:2852 seq_vprintf fs/seq_file.c:391 [inline] seq_printf+0x178/0x270 fs/seq_file.c:406 input_devices_seq_show+0x145/0x640 drivers/input/input.c:1133 seq_read_iter+0x4e7/0xe10 fs/seq_file.c:230 seq_read+0x2e2/0x3d0 fs/seq_file.c:162 pde_read fs/proc/inode.c:308 [inline] proc_reg_read+0x1e6/0x2e0 fs/proc/inode.c:320 do_loop_readv_writev include/linux/uio.h:-1 [inline] vfs_readv+0x5a2/0x840 fs/read_write.c:1018 do_preadv fs/read_write.c:1130 [inline] __do_sys_preadv fs/read_write.c:1177 [inline] __se_sys_preadv fs/read_write.c:1172 [inline] __x64_sys_preadv+0x197/0x2a0 fs/read_write.c:1172 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f940078e969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f93fe5f6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00007f94009b5fa0 RCX: 00007f940078e969 RDX: 0000000000000001 RSI: 0000200000000740 RDI: 0000000000000004 RBP: 00007f9400810ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000401 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f94009b5fa0 R15: 00007f9400adfa28 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x52f9c flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5836, tgid 5836 (udevd), ts 413146919890, free_ts 426265039509 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x21ce/0x22b0 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2618 new_slab mm/slub.c:2672 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3858 __slab_alloc mm/slub.c:3948 [inline] __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] __do_kmalloc_node mm/slub.c:4326 [inline] __kmalloc_noprof+0x305/0x4f0 mm/slub.c:4339 kmalloc_noprof include/linux/slab.h:909 [inline] tomoyo_realpath_from_path+0xe3/0x5d0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x1e8/0x5a0 security/tomoyo/file.c:723 tomoyo_path_mknod+0x142/0x190 security/tomoyo/tomoyo.c:252 security_path_mknod+0x17e/0x3a0 security/security.c:1899 may_o_create fs/namei.c:3520 [inline] lookup_open fs/namei.c:3664 [inline] open_last_lookups fs/namei.c:3800 [inline] path_openat+0xd56/0x3830 fs/namei.c:4036 do_filp_open+0x1fa/0x410 fs/namei.c:4066 do_sys_openat2+0x121/0x1c0 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_openat fs/open.c:1460 [inline] __se_sys_openat fs/open.c:1455 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1455 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 page last free pid 5190 tgid 5190 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0xb0e/0xcd0 mm/page_alloc.c:2725 discard_slab mm/slub.c:2716 [inline] __put_partials+0x161/0x1c0 mm/slub.c:3185 put_cpu_partial+0x17c/0x250 mm/slub.c:3260 __slab_free+0x2f7/0x400 mm/slub.c:4512 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_node_noprof+0x1bb/0x3c0 mm/slub.c:4248 __alloc_skb+0x112/0x2d0 net/core/skbuff.c:658 alloc_skb include/linux/skbuff.h:1340 [inline] alloc_skb_with_frags+0xca/0x890 net/core/skbuff.c:6639 sock_alloc_send_pskb+0x857/0x990 net/core/sock.c:2954 unix_dgram_sendmsg+0x5c2/0x17c0 net/unix/af_unix.c:2007 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x219/0x270 net/socket.c:727 __sys_sendto+0x3bd/0x520 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+0xf6/0x210 arch/x86/entry/syscall_64.c:94 Memory state around the buggy address: ffff888052f9c900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888052f9c980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888052f9ca00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888052f9ca80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888052f9cb00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================