================================================================== BUG: KASAN: slab-out-of-bounds in vc_con_write_normal drivers/tty/vt/vt.c:3010 [inline] BUG: KASAN: slab-out-of-bounds in do_con_write+0x332a/0x7bb0 drivers/tty/vt/vt.c:3096 Write of size 2 at addr ffff88804eb11fc4 by task syz.1.613/9295 CPU: 1 UID: 0 PID: 9295 Comm: syz.1.613 Tainted: G U 6.14.0-rc5-syzkaller-00013-g99fa936e8e4f #0 Tainted: [U]=USER Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xc3/0x670 mm/kasan/report.c:521 kasan_report+0xd9/0x110 mm/kasan/report.c:634 vc_con_write_normal drivers/tty/vt/vt.c:3010 [inline] do_con_write+0x332a/0x7bb0 drivers/tty/vt/vt.c:3096 con_put_char+0x74/0xa0 drivers/tty/vt/vt.c:3440 tty_put_char+0xbc/0x160 drivers/tty/tty_io.c:3166 n_tty_process_echo_ops drivers/tty/n_tty.c:663 [inline] __process_echoes+0x7fe/0xb40 drivers/tty/n_tty.c:709 flush_echoes drivers/tty/n_tty.c:807 [inline] __receive_buf drivers/tty/n_tty.c:1642 [inline] n_tty_receive_buf_common+0xa2a/0x1980 drivers/tty/n_tty.c:1739 tiocsti drivers/tty/tty_io.c:2299 [inline] tty_ioctl+0x575/0x15d0 drivers/tty/tty_io.c:2716 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x190/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd783b8d169 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:00007fd7819d5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fd783da6080 RCX: 00007fd783b8d169 RDX: 0000000000000038 RSI: 0000000000005412 RDI: 0000000000000003 RBP: 00007fd783c0e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd783da6080 R15: 00007fffe0fec138 Allocated by task 8006: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4294 [inline] __kmalloc_noprof+0x21c/0x510 mm/slub.c:4306 kmalloc_noprof include/linux/slab.h:905 [inline] tomoyo_realpath_from_path+0xb9/0x720 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x248/0x590 security/tomoyo/file.c:723 security_file_ioctl+0x9b/0x240 security/security.c:2913 __do_sys_ioctl fs/ioctl.c:900 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0xb7/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 8006: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4609 [inline] kfree+0x2c4/0x4d0 mm/slub.c:4757 tomoyo_realpath_from_path+0x1ad/0x720 security/tomoyo/realpath.c:286 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x248/0x590 security/tomoyo/file.c:723 security_file_ioctl+0x9b/0x240 security/security.c:2913 __do_sys_ioctl fs/ioctl.c:900 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0xb7/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88804eb10000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 4036 bytes to the right of allocated 4096-byte region [ffff88804eb10000, ffff88804eb11000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4eb10 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b042140 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b042140 dead000000000100 dead000000000122 head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea00013ac401 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8006, tgid 8006 (udevd), ts 224997320910, free_ts 224988799871 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x221/0x2470 mm/page_alloc.c:4739 alloc_pages_mpol+0x1fc/0x540 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2587 [inline] new_slab+0x23d/0x330 mm/slub.c:2640 ___slab_alloc+0xc5d/0x1720 mm/slub.c:3826 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_noprof+0x2ec/0x510 mm/slub.c:4306 kmalloc_noprof include/linux/slab.h:905 [inline] tomoyo_realpath_from_path+0xb9/0x720 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path2_perm+0x36f/0x710 security/tomoyo/file.c:923 tomoyo_path_rename+0x102/0x1b0 security/tomoyo/tomoyo.c:300 security_path_rename+0x18e/0x3c0 security/security.c:2026 do_renameat2+0x7a0/0xdd0 fs/namei.c:5213 __do_sys_rename fs/namei.c:5273 [inline] __se_sys_rename fs/namei.c:5271 [inline] __x64_sys_rename+0x7d/0xa0 fs/namei.c:5271 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5208 tgid 5208 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0x6db/0xfb0 mm/page_alloc.c:2660 __put_partials+0x14c/0x170 mm/slub.c:3153 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4115 [inline] slab_alloc_node mm/slub.c:4164 [inline] kmem_cache_alloc_noprof+0x226/0x3d0 mm/slub.c:4171 getname_flags.part.0+0x4c/0x550 fs/namei.c:139 getname_flags+0x93/0xf0 include/linux/audit.h:322 do_readlinkat+0xb5/0x390 fs/stat.c:563 __do_sys_readlink fs/stat.c:601 [inline] __se_sys_readlink fs/stat.c:598 [inline] __x64_sys_readlink+0x78/0xc0 fs/stat.c:598 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88804eb11e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804eb11f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88804eb11f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88804eb12000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804eb12080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================