syzbot


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

Status: upstream: reported syz repro on 2025/10/22 04:41
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+fe3b14083a5cbf446b34@syzkaller.appspotmail.com
First crash: 58d, last: 30d
Bug presence (1)
Date Name Commit Repro Result
2025/11/15 upstream (ToT) 7a0892d2836e syz [report] KASAN: slab-use-after-free Read in tty_write_room
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 457d 457d 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 312d 312d 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 1202d 1460d 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 249d 381d 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 792d 792d 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 102d 168d 0/3 auto-obsoleted due to no activity on 2025/12/16 21:38
upstream BUG: unable to handle kernel NULL pointer dereference in tty_write_room serial 19 syz error 6 906d 963d 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 249 21h56m 703d 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 803d 799d 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+0x3c/0x8c drivers/tty/tty_ioctl.c:79
Read of size 8 at addr ffff0000df450018 by task aoe_tx0/2062

CPU: 0 PID: 2062 Comm: aoe_tx0 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
 print_address_description+0x88/0x218 mm/kasan/report.c:316
 print_report+0x50/0x68 mm/kasan/report.c:420
 kasan_report+0xa8/0x100 mm/kasan/report.c:524
 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
 tty_write_room+0x3c/0x8c drivers/tty/tty_ioctl.c:79
 handle_tx+0x120/0x5f8 drivers/net/caif/caif_serial.c:226
 caif_xmit+0x108/0x150 drivers/net/caif/caif_serial.c:282
 __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+0x244/0x8e0 net/core/dev.c:3686
 __dev_queue_xmit+0x155c/0x309c net/core/dev.c:4346
 dev_queue_xmit include/linux/netdevice.h:3051 [inline]
 tx+0x9c/0x1c8 drivers/block/aoe/aoenet.c:63
 kthread+0x160/0x330 drivers/block/aoe/aoecmd.c:1241
 kthread+0x250/0x2d8 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

Allocated by task 28738:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
 kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 kmalloc_trace+0x7c/0x94 mm/slab_common.c:1031
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 alloc_tty_struct+0xb8/0x654 drivers/tty/tty_io.c:3089
 tty_init_dev+0x60/0x3e8 drivers/tty/tty_io.c:1408
 ptmx_open+0xfc/0x2d0 drivers/tty/pty.c:824
 chrdev_open+0x26c/0x4f0 fs/char_dev.c:414
 do_dentry_open+0x730/0xfa8 fs/open.c:882
 vfs_open+0x7c/0x90 fs/open.c:1013
 do_open fs/namei.c:3634 [inline]
 path_openat+0x1f48/0x2680 fs/namei.c:3791
 do_filp_open+0x174/0x344 fs/namei.c:3818
 do_sys_openat2+0x128/0x3d8 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]
 __arm64_sys_openat+0x120/0x154 fs/open.c:1345
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Freed by task 4438:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
 kasan_save_free_info+0x3c/0x60 mm/kasan/generic.c:516
 ____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:236
 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1729 [inline]
 slab_free_freelist_hook+0x16c/0x1ec mm/slub.c:1755
 slab_free mm/slub.c:3687 [inline]
 __kmem_cache_free+0xc0/0x224 mm/slub.c:3700
 kfree+0xd0/0x1ac mm/slab_common.c:988
 free_tty_struct drivers/tty/tty_io.c:173 [inline]
 release_one_tty+0x21c/0x238 drivers/tty/tty_io.c:1541
 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
 worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439
 kthread+0x250/0x2d8 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

Last potentially related work creation:
 kasan_save_stack+0x40/0x70 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xc0/0xdc mm/kasan/generic.c:486
 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
 insert_work+0x64/0x37c kernel/workqueue.c:1361
 __queue_work+0xcbc/0x123c kernel/workqueue.c:1520
 queue_work_on+0xc0/0x16c kernel/workqueue.c:1548
 queue_work include/linux/workqueue.h:512 [inline]
 schedule_work include/linux/workqueue.h:573 [inline]
 queue_release_one_tty drivers/tty/tty_io.c:1552 [inline]
 kref_put include/linux/kref.h:65 [inline]
 tty_kref_put+0x144/0x1b8 drivers/tty/tty_io.c:1565
 release_tty+0x3e8/0x4a4 drivers/tty/tty_io.c:1601
 tty_release_struct+0xb4/0xd4 drivers/tty/tty_io.c:1700
 tty_release+0xa0c/0x1208 drivers/tty/tty_io.c:1860
 __fput+0x1bc/0x7c0 fs/file_table.c:320
 ____fput+0x20/0x30 fs/file_table.c:348
 task_work_run+0x1ec/0x270 kernel/task_work.c:203
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 do_notify_resume+0x2038/0x2b28 arch/arm64/kernel/signal.c:1137
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
 el0_svc+0x98/0x138 arch/arm64/kernel/entry-common.c:638
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Second to last potentially related work creation:
 kasan_save_stack+0x40/0x70 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xc0/0xdc mm/kasan/generic.c:486
 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
 call_rcu+0x100/0x954 kernel/rcu/tree.c:2849
 in6_dev_finish_destroy+0x158/0x1d8 net/ipv6/addrconf_core.c:278
 in6_dev_put include/net/addrconf.h:388 [inline]
 addrconf_ifdown+0x1354/0x15dc net/ipv6/addrconf.c:3954
 addrconf_notify+0x2f4/0xca8 net/ipv6/addrconf.c:-1
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xd4/0x164 kernel/notifier.c:455
 call_netdevice_notifiers_info net/core/dev.c:2001 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2039 [inline]
 call_netdevice_notifiers net/core/dev.c:2053 [inline]
 unregister_netdevice_many+0xe2c/0x1740 net/core/dev.c:10990
 unregister_netdevice_queue+0x2ac/0x2f8 net/core/dev.c:10921
 unregister_netdevice include/linux/netdevice.h:3075 [inline]
 ser_release+0x16c/0x1ec drivers/net/caif/caif_serial.c:310
 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
 process_scheduled_works kernel/workqueue.c:2355 [inline]
 worker_thread+0xb30/0xfbc kernel/workqueue.c:2441
 kthread+0x250/0x2d8 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

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

The buggy address belongs to the physical page:
page:00000000e0baf2ed refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11f450
head:00000000e0baf2ed order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff0000f15d1c01
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc000325ca00 dead000000000002 ffff0000c0003380
raw: 0000000000000000 0000000000080008 00000001ffffffff ffff0000f15d1c01
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000df44ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000df44ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000df450000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff0000df450080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff0000df450100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Unable to handle kernel paging request at virtual address e0f1207c80000200
KASAN: maybe wild-memory-access in range [0x078d03e400001000-0x078d03e400001007]
Mem abort info:
  ESR = 0x0000000096000004
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
  FSC = 0x04: level 0 translation fault
Data abort info:
  ISV = 0, ISS = 0x00000004
  CM = 0, WnR = 0
[e0f1207c80000200] address between user and kernel address ranges
Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 2062 Comm: aoe_tx0 Tainted: G    B              syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
pstate: 824000c5 (Nzcv daIF +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : get_work_pool+0xf8/0x198 kernel/workqueue.c:739
lr : work_struct_pwq kernel/workqueue.c:703 [inline]
lr : get_work_pool+0xf0/0x198 kernel/workqueue.c:739
sp : ffff800027187700
x29: ffff800027187700 x28: 0000000000000000 x27: 0000000000000008
x26: ffff0000ee8ee820 x25: dfff800000000000 x24: ffff0000c0038000
x23: ffff0000c00291c0 x22: ffff00019f6cac40 x21: 078d03e400001157
x20: dfff800000000000 x19: 078d03e400001000 x18: ffff800011abbcc0
x17: 0000000000000000 x16: ffff800008042d90 x15: 0000000000000000
x14: 00000000ffff8000 x13: 0000000000000000 x12: 0000000000ff0100
x11: ff008000081f95a8 x10: 0000000000000000 x9 : ffff8000081f95a8
x8 : 00f1a07c80000200 x7 : 0010a28800000000 x6 : ffff8000082055e0
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000081f94fc
x2 : 0000000000000000 x1 : 0000000000000004 x0 : 0000000000000000
Call trace:
 get_work_pool+0xf8/0x198 kernel/workqueue.c:739
 __queue_work+0x4b8/0x123c kernel/workqueue.c:1461
 queue_work_on+0xc0/0x16c kernel/workqueue.c:1548
 queue_work include/linux/workqueue.h:512 [inline]
 tty_insert_flip_string_and_push_buffer+0x2bc/0x308 drivers/tty/tty_buffer.c:634
 pty_write+0xac/0xe4 drivers/tty/pty.c:118
 handle_tx+0x1ec/0x5f8 drivers/net/caif/caif_serial.c:236
 caif_xmit+0x108/0x150 drivers/net/caif/caif_serial.c:282
 __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+0x244/0x8e0 net/core/dev.c:3686
 __dev_queue_xmit+0x155c/0x309c net/core/dev.c:4346
 dev_queue_xmit include/linux/netdevice.h:3051 [inline]
 tx+0x9c/0x1c8 drivers/block/aoe/aoenet.c:63
 kthread+0x160/0x330 drivers/block/aoe/aoecmd.c:1241
 kthread+0x250/0x2d8 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850
Code: 1400000f 940aa1b7 9277dab3 d343fe68 (38746908) 
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
   0:	1400000f 	b	0x3c
   4:	940aa1b7 	bl	0x2a86e0
   8:	9277dab3 	and	x19, x21, #0xfffffffffffffe00
   c:	d343fe68 	lsr	x8, x19, #3
* 10:	38746908 	ldrb	w8, [x8, x20] <-- trapping instruction

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/14 09:46 linux-6.1.y f6e38ae624cf 07e030de .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in tty_write_room
2025/11/19 11:50 linux-6.1.y f6e38ae624cf 26ee5237 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in tty_write_room
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.