syzbot


KASAN: use-after-free Read in tty_write_room (4)

Status: upstream: reported on 2025/07/04 04:13
Reported-by: syzbot+1d6919f93241262dc4b0@syzkaller.appspotmail.com
First crash: 111d, last: 45d
Similar bugs (9)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in tty_write_room (2) 19 1 1d00h 1d00h 0/3 upstream: reported on 2025/10/22 04:41
linux-5.15 KASAN: use-after-free Read in tty_write_room (2) 19 1 400d 400d 0/3 auto-obsoleted due to no activity on 2024/12/27 00:19
linux-5.15 KASAN: use-after-free Read in tty_write_room (3) 19 1 255d 255d 0/3 auto-obsoleted due to no activity on 2025/05/21 00:47
upstream KASAN: use-after-free Read in tty_write_room serial 19 12 1145d 1402d 0/29 auto-obsoleted due to no activity on 2023/01/01 23:03
linux-6.1 KASAN: use-after-free Read in tty_write_room 19 4 192d 323d 0/3 auto-obsoleted due to no activity on 2025/07/22 23:58
linux-5.15 KASAN: use-after-free Read in tty_write_room 19 1 734d 734d 0/3 auto-obsoleted due to no activity on 2024/01/27 09:51
upstream BUG: unable to handle kernel NULL pointer dereference in tty_write_room serial 19 syz error 6 848d 905d 0/29 auto-obsoleted due to no activity on 2023/10/05 13:52
upstream KASAN: slab-use-after-free Read in tty_write_room (2) serial 19 syz error error 221 2h23m 645d 0/29 upstream: reported syz repro on 2024/01/16 15:06
upstream KASAN: slab-use-after-free Read in tty_write_room serial 19 1 746d 742d 0/29 auto-obsoleted due to no activity on 2024/01/09 18:18

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in tty_write_room+0x31/0x80 drivers/tty/tty_ioctl.c:78
Read of size 8 at addr ffff888060bf3018 by task aoe_tx0/1428

CPU: 0 PID: 1428 Comm: aoe_tx0 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 tty_write_room+0x31/0x80 drivers/tty/tty_ioctl.c:78
 handle_tx+0x164/0x600 drivers/net/caif/caif_serial.c:226
 __netdev_start_xmit include/linux/netdevice.h:5027 [inline]
 netdev_start_xmit include/linux/netdevice.h:5041 [inline]
 xmit_one net/core/dev.c:3649 [inline]
 dev_hard_start_xmit+0x2a5/0x7e0 net/core/dev.c:3665
 __dev_queue_xmit+0x19df/0x2ed0 net/core/dev.c:4288
 tx+0x65/0x160 drivers/block/aoe/aoenet.c:63
 kthread+0x1bc/0x390 drivers/block/aoe/aoecmd.c:1238
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
 </TASK>

Allocated by task 13762:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc mm/kasan/common.c:513 [inline]
 __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522
 kmalloc include/linux/slab.h:604 [inline]
 kzalloc include/linux/slab.h:735 [inline]
 alloc_tty_struct+0xa6/0x780 drivers/tty/tty_io.c:3127
 tty_init_dev+0x56/0x470 drivers/tty/tty_io.c:1424
 tty_open_by_driver drivers/tty/tty_io.c:2100 [inline]
 tty_open+0x5b9/0xd20 drivers/tty/tty_io.c:2148
 chrdev_open+0x597/0x670 fs/char_dev.c:414
 do_dentry_open+0x7ff/0xf80 fs/open.c:826
 do_open fs/namei.c:3608 [inline]
 path_openat+0x2682/0x2f30 fs/namei.c:3742
 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769
 do_sys_openat2+0x142/0x4a0 fs/open.c:1253
 do_sys_open fs/open.c:1269 [inline]
 __do_sys_openat fs/open.c:1285 [inline]
 __se_sys_openat fs/open.c:1280 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1280
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 6894:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0xea/0x170 mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0xef/0x2a0 mm/slub.c:4559
 process_one_work+0x863/0x1000 kernel/workqueue.c:2310
 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Last potentially related work creation:
 kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
 insert_work+0x54/0x3d0 kernel/workqueue.c:1366
 __queue_work+0x9c5/0xd50 kernel/workqueue.c:1532
 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1559
 tty_release_struct+0xb4/0xd0 drivers/tty/tty_io.c:1719
 tty_release+0xd0c/0x16c0 drivers/tty/tty_io.c:1880
 __fput+0x234/0x930 fs/file_table.c:311
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Second to last potentially related work creation:
 kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
 __call_rcu kernel/rcu/tree.c:3011 [inline]
 call_rcu+0x182/0x930 kernel/rcu/tree.c:3091
 netlink_release+0x134f/0x1790 net/netlink/af_netlink.c:799
 __sock_release net/socket.c:649 [inline]
 sock_close+0xd5/0x240 net/socket.c:1336
 __fput+0x234/0x930 fs/file_table.c:311
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 exit_task_work include/linux/task_work.h:33 [inline]
 do_exit+0x61e/0x20a0 kernel/exit.c:883
 do_group_exit+0x12e/0x300 kernel/exit.c:997
 get_signal+0x6ca/0x12c0 kernel/signal.c:2900
 arch_do_signal_or_restart+0xc1/0x1300 arch/x86/kernel/signal.c:867
 handle_signal_work kernel/entry/common.c:154 [inline]
 exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:178
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff888060bf3000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 24 bytes inside of
 2048-byte region [ffff888060bf3000, ffff888060bf3800)
The buggy address belongs to the page:
page:ffffea000182fc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x60bf0
head:ffffea000182fc00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888016842000
raw: 0000000000000000 0000000000080008 00000001ffffffff 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4188, ts 68679060323, free_ts 22054315002
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
 alloc_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3008
 __slab_alloc mm/slub.c:3095 [inline]
 slab_alloc_node mm/slub.c:3186 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc_trace+0x1a5/0x2a0 mm/slub.c:3245
 kmalloc include/linux/slab.h:604 [inline]
 kzalloc include/linux/slab.h:735 [inline]
 ipv6_add_dev+0xce/0x1190 net/ipv6/addrconf.c:384
 addrconf_notify+0x66f/0xf00 net/ipv6/addrconf.c:3576
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
 call_netdevice_notifiers net/core/dev.c:2075 [inline]
 register_netdevice+0x1275/0x16b0 net/core/dev.c:10428
 veth_newlink+0x668/0xda0 drivers/net/veth.c:1683
 __rtnl_newlink net/core/rtnetlink.c:3524 [inline]
 rtnl_newlink+0x114c/0x17d0 net/core/rtnetlink.c:3572
 rtnetlink_rcv_msg+0x9b9/0xe60 net/core/rtnetlink.c:5650
 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2507
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x774/0x920 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x8ab/0xbc0 net/netlink/af_netlink.c:1918
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 __sys_sendto+0x423/0x580 net/socket.c:2063
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
 free_unref_page+0x94/0x280 mm/page_alloc.c:3396
 free_contig_range+0x96/0xf0 mm/page_alloc.c:9406
 destroy_args+0x100/0xa20 mm/debug_vm_pgtable.c:1018
 debug_vm_pgtable+0x318/0x370 mm/debug_vm_pgtable.c:1336
 do_one_initcall+0x1ee/0x680 init/main.c:1302
 do_initcall_level+0x137/0x1f0 init/main.c:1375
 do_initcalls+0x4b/0x90 init/main.c:1391
 kernel_init_freeable+0x3ce/0x560 init/main.c:1615
 kernel_init+0x19/0x1b0 init/main.c:1506
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Memory state around the buggy address:
 ffff888060bf2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888060bf2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888060bf3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888060bf3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888060bf3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/07 21:37 linux-5.15.y 7a6c2d093c45 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tty_write_room
2025/07/04 04:13 linux-5.15.y 3dea0e7f549e 76ad128c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tty_write_room
* Struck through repros no longer work on HEAD.