syzbot


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

Status: upstream: reported on 2025/10/22 04:41
Reported-by: syzbot+fe3b14083a5cbf446b34@syzkaller.appspotmail.com
First crash: 1d08h, last: 1d08h
Similar bugs (9)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
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 1403d 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 324d 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 735d 735d 0/3 auto-obsoleted due to no activity on 2024/01/27 09:51
linux-5.15 KASAN: use-after-free Read in tty_write_room (4) 19 2 45d 111d 0/3 upstream: reported on 2025/07/04 04:13
upstream BUG: unable to handle kernel NULL pointer dereference in tty_write_room serial 19 syz error 6 848d 906d 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 10h49m 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:
ieee802154 phy0 wpan0: encryption failed: -22
ieee802154 phy1 wpan1: encryption failed: -22
==================================================================
BUG: KASAN: use-after-free in tty_write_room+0x31/0x80 drivers/tty/tty_ioctl.c:79
Read of size 8 at addr ffff888076255018 by task aoe_tx0/1277

CPU: 0 PID: 1277 Comm: aoe_tx0 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0xa8/0x210 mm/kasan/report.c:420
 kasan_report+0x10b/0x140 mm/kasan/report.c:524
 tty_write_room+0x31/0x80 drivers/tty/tty_ioctl.c:79
 handle_tx+0x164/0x600 drivers/net/caif/caif_serial.c:226
 __netdev_start_xmit include/linux/netdevice.h:4896 [inline]
 netdev_start_xmit include/linux/netdevice.h:4910 [inline]
 xmit_one net/core/dev.c:3670 [inline]
 dev_hard_start_xmit+0x262/0x870 net/core/dev.c:3686
 __dev_queue_xmit+0x1bf1/0x3760 net/core/dev.c:4346
 dev_queue_xmit include/linux/netdevice.h:3051 [inline]
 tx+0x67/0x170 drivers/block/aoe/aoenet.c:63
 kthread+0x1c6/0x3b0 drivers/block/aoe/aoecmd.c:1241
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 8165:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 alloc_tty_struct+0xa6/0x740 drivers/tty/tty_io.c:3089
 tty_init_dev+0x55/0x4c0 drivers/tty/tty_io.c:1408
 ptmx_open+0xdb/0x2c0 drivers/tty/pty.c:824
 chrdev_open+0x597/0x670 fs/char_dev.c:414
 do_dentry_open+0x7e9/0x10d0 fs/open.c:882
 do_open fs/namei.c:3634 [inline]
 path_openat+0x25c6/0x2e70 fs/namei.c:3791
 do_filp_open+0x1c1/0x3c0 fs/namei.c:3818
 do_sys_openat2+0x142/0x490 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1345
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 4344:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1729 [inline]
 slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1755
 slab_free mm/slub.c:3687 [inline]
 __kmem_cache_free+0xb6/0x1f0 mm/slub.c:3700
 process_one_work+0x898/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 insert_work+0x54/0x3c0 kernel/workqueue.c:1361
 __queue_work+0xba3/0xfb0 kernel/workqueue.c:1520
 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1548
 tty_release_struct+0xb4/0xd0 drivers/tty/tty_io.c:1700
 tty_release+0xc72/0x1600 drivers/tty/tty_io.c:1860
 __fput+0x22c/0x920 fs/file_table.c:320
 task_work_run+0x1ca/0x250 kernel/task_work.c:203
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Second to last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 insert_work+0x54/0x3c0 kernel/workqueue.c:1361
 __queue_work+0xba3/0xfb0 kernel/workqueue.c:1520
 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1548
 tty_release_struct+0xb4/0xd0 drivers/tty/tty_io.c:1700
 tty_release+0xc72/0x1600 drivers/tty/tty_io.c:1860
 __fput+0x22c/0x920 fs/file_table.c:320
 task_work_run+0x1ca/0x250 kernel/task_work.c:203
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff888076255000
 which belongs to the cache kmalloc-cg-2k of size 2048
The buggy address is located 24 bytes inside of
 2048-byte region [ffff888076255000, ffff888076255800)

The buggy address belongs to the physical page:
page:ffffea0001d89400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76250
head:ffffea0001d89400 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888058960e01
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff88801744c140
raw: 0000000000000000 0000000000080008 00000001ffffffff ffff888058960e01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5877, tgid 5875 (syz.4.509), ts 141022524876, free_ts 141019115886
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
 prep_new_page mm/page_alloc.c:2539 [inline]
 get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614
 alloc_pages_preferred_many mm/mempolicy.c:2141 [inline]
 alloc_pages+0x21a/0x740 mm/mempolicy.c:2279
 alloc_slab_page+0x5d/0x160 mm/slub.c:1799
 allocate_slab mm/slub.c:1944 [inline]
 new_slab+0x87/0x2c0 mm/slub.c:1997
 ___slab_alloc+0xbc6/0x1230 mm/slub.c:3154
 __slab_alloc mm/slub.c:3240 [inline]
 slab_alloc_node mm/slub.c:3325 [inline]
 __kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3398
 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1026
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 ipv6_add_dev+0xf8/0x1120 net/ipv6/addrconf.c:379
 addrconf_notify+0x634/0xf40 net/ipv6/addrconf.c:3595
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455
 call_netdevice_notifiers_extack net/core/dev.c:2039 [inline]
 call_netdevice_notifiers net/core/dev.c:2053 [inline]
 register_netdevice+0x1600/0x1aa0 net/core/dev.c:10237
 register_netdev+0x37/0x50 net/core/dev.c:10332
 vti6_init_net+0x210/0x330 net/ipv6/ip6_vti.c:1165
 ops_init+0x355/0x5f0 net/core/net_namespace.c:138
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1459 [inline]
 free_pcp_prepare mm/page_alloc.c:1509 [inline]
 free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
 free_slab mm/slub.c:2036 [inline]
 discard_slab mm/slub.c:2042 [inline]
 __unfreeze_partials+0x1a5/0x200 mm/slub.c:2591
 put_cpu_partial+0x17c/0x250 mm/slub.c:2667
 qlink_free mm/kasan/quarantine.c:168 [inline]
 qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
 __kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
 slab_alloc_node mm/slub.c:3359 [inline]
 kmem_cache_alloc_node+0x14d/0x320 mm/slub.c:3404
 __alloc_skb+0xfc/0x7e0 net/core/skbuff.c:505
 alloc_skb include/linux/skbuff.h:1271 [inline]
 nlmsg_new include/net/netlink.h:991 [inline]
 inet_netconf_notify_devconf+0x16f/0x230 net/ipv4/devinet.c:2128
 __devinet_sysctl_register+0x2b3/0x320 net/ipv4/devinet.c:2618
 devinet_sysctl_register+0x17c/0x1f0 net/ipv4/devinet.c:2652
 inetdev_init+0x2b4/0x4f0 net/ipv4/devinet.c:280
 inetdev_event+0x270/0x1410 net/ipv4/devinet.c:1547
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455

Memory state around the buggy address:
 ffff888076254f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888076254f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888076255000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888076255080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888076255100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/22 04:40 linux-6.1.y 8e6e2188d949 252fbbad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in tty_write_room
* Struck through repros no longer work on HEAD.