syzbot


KASAN: slab-out-of-bounds Write in do_con_write (2)

Status: moderation: reported on 2025/08/23 16:55
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+f16f353b701fe8be7445@syzkaller.appspotmail.com
First crash: 14d, last: 6h34m
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Write in do_con_write serial 23 4 129d 207d 0/29 auto-obsoleted due to no activity on 2025/08/04 16:13

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in vc_con_write_normal drivers/tty/vt/vt.c:3086 [inline]
BUG: KASAN: slab-out-of-bounds in do_con_write+0x3839/0x8280 drivers/tty/vt/vt.c:3178
Write of size 2 at addr ffff88806ba3df94 by task syz.1.2367/17750

CPU: 0 UID: 0 PID: 17750 Comm: syz.1.2367 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 __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:378 [inline]
 print_report+0xcd/0x630 mm/kasan/report.c:482
 kasan_report+0xe0/0x110 mm/kasan/report.c:595
 vc_con_write_normal drivers/tty/vt/vt.c:3086 [inline]
 do_con_write+0x3839/0x8280 drivers/tty/vt/vt.c:3178
 con_write+0x23/0xb0 drivers/tty/vt/vt.c:3516
 process_output_block drivers/tty/n_tty.c:561 [inline]
 n_tty_write+0x41c/0x11e0 drivers/tty/n_tty.c:2377
 iterate_tty_write drivers/tty/tty_io.c:1006 [inline]
 file_tty_write.constprop.0+0x504/0x9b0 drivers/tty/tty_io.c:1081
 tty_write drivers/tty/tty_io.c:1102 [inline]
 redirected_tty_write drivers/tty/tty_io.c:1125 [inline]
 redirected_tty_write+0xd4/0x150 drivers/tty/tty_io.c:1105
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0x7d0/0x11d0 fs/read_write.c:686
 ksys_write+0x12a/0x250 fs/read_write.c:738
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x490 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f406058ebe9
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:00007f40614f0038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f40607c5fa0 RCX: 00007f406058ebe9
RDX: 0000000000000026 RSI: 00002000000005c0 RDI: 0000000000000003
RBP: 00007f4060611e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f40607c6038 R14: 00007f40607c5fa0 R15: 00007ffcdb441a28
 </TASK>

Allocated by task 17461:
 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:388 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405
 kasan_kmalloc include/linux/kasan.h:260 [inline]
 __do_kmalloc_node mm/slub.c:4365 [inline]
 __kmalloc_noprof+0x223/0x510 mm/slub.c:4377
 kmalloc_noprof include/linux/slab.h:909 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 vc_do_resize+0x1de/0x10e0 drivers/tty/vt/vt.c:1182
 vc_resize include/linux/vt_kern.h:49 [inline]
 vgacon_init+0x37c/0x440 drivers/video/console/vgacon.c:392
 visual_init+0x320/0x620 drivers/tty/vt/vt.c:1019
 do_bind_con_driver.isra.0+0x57a/0xbf0 drivers/tty/vt/vt.c:3915
 do_unbind_con_driver+0x571/0x6d0 drivers/tty/vt/vt.c:4024
 vt_unbind drivers/tty/vt/vt.c:4110 [inline]
 store_bind+0x421/0x760 drivers/tty/vt/vt.c:4145
 dev_attr_store+0x58/0x80 drivers/base/core.c:2437
 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
 kernfs_fop_write_iter+0x354/0x510 fs/kernfs/file.c:334
 do_iter_readv_writev+0x662/0x9e0 fs/read_write.c:827
 vfs_writev+0x35f/0xde0 fs/read_write.c:1057
 do_writev+0x132/0x340 fs/read_write.c:1103
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x490 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88806ba3c000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 4084 bytes to the right of
 allocated 4000-byte region [ffff88806ba3c000, ffff88806ba3cfa0)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6ba38
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801b842140 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b842140 0000000000000000 dead000000000001
head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea0001ae8e01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
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 16866, tgid 16863 (syz.0.2191), ts 998230231715, free_ts 985175812738
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851
 prep_new_page mm/page_alloc.c:1859 [inline]
 get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858
 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148
 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416
 alloc_slab_page mm/slub.c:2487 [inline]
 allocate_slab mm/slub.c:2655 [inline]
 new_slab+0x247/0x330 mm/slub.c:2709
 ___slab_alloc+0xcf2/0x1740 mm/slub.c:3891
 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3981
 __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_noprof+0x2f2/0x510 mm/slub.c:4377
 kmalloc_noprof include/linux/slab.h:909 [inline]
 tomoyo_realpath_from_path+0xc2/0x6e0 security/tomoyo/realpath.c:251
 tomoyo_get_exe+0x63/0xa0 security/tomoyo/util.c:978
 tomoyo_manager security/tomoyo/common.c:943 [inline]
 tomoyo_write_control+0x689/0x1430 security/tomoyo/common.c:2823
 vfs_write+0x29d/0x11d0 fs/read_write.c:684
 ksys_write+0x12a/0x250 fs/read_write.c:738
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x490 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 16786 tgid 16777 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1395 [inline]
 __free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895
 discard_slab mm/slub.c:2753 [inline]
 __put_partials+0x165/0x1c0 mm/slub.c:3218
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x4d/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:340
 kasan_slab_alloc include/linux/kasan.h:250 [inline]
 slab_post_alloc_hook mm/slub.c:4180 [inline]
 slab_alloc_node mm/slub.c:4229 [inline]
 __kmalloc_cache_noprof+0x1f1/0x3e0 mm/slub.c:4391
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 inetdev_init+0x66/0x5a0 net/ipv4/devinet.c:273
 inetdev_event+0xc5f/0x18a0 net/ipv4/devinet.c:1591
 notifier_call_chain+0xbc/0x410 kernel/notifier.c:85
 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2229
 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline]
 call_netdevice_notifiers net/core/dev.c:2281 [inline]
 register_netdevice+0x182e/0x2270 net/core/dev.c:11244
 __ip_tunnel_create+0x540/0x6e0 net/ipv4/ip_tunnel.c:268
 ip_tunnel_init_net+0x22f/0x7d0 net/ipv4/ip_tunnel.c:1161
 ops_init+0x1e2/0x5f0 net/core/net_namespace.c:136
 setup_net+0x10f/0x380 net/core/net_namespace.c:438
 copy_net_ns+0x2a6/0x5f0 net/core/net_namespace.c:570

Memory state around the buggy address:
 ffff88806ba3de80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88806ba3df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88806ba3df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                         ^
 ffff88806ba3e000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88806ba3e080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/02 15:31 upstream b320789d6883 96a211bc .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-out-of-bounds Write in do_con_write
2025/08/28 11:24 upstream 07d9df80082b bee60a83 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-out-of-bounds Write in do_con_write
2025/08/27 04:43 upstream fab1beda7597 e12e5ba4 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-out-of-bounds Write in do_con_write
2025/08/19 16:54 upstream be48bcf004f9 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-out-of-bounds Write in do_con_write
* Struck through repros no longer work on HEAD.