KASAN: use-after-free Write in release_tty

Status: premoderation: reported on 2026/08/10 10:24
Reported-by: syzbot+2387287fec5b18cf402b@syzkaller.appspotmail.com
First crash: 4d20h, last: 4d20h
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Write in release_tty 22 syz, C done 148 2330d 2447d 1/1 fixed on 2020/04/28 10:48
upstream KASAN: use-after-free Write in release_tty 22 syz, C done 591 2324d 2446d 15/29 fixed on 2020/05/10 10:41
linux-4.14 KASAN: use-after-free Write in release_tty 22 syz, C done 124 2326d 2446d 1/1 fixed on 2020/05/01 20:49
upstream KASAN: slab-use-after-free Write in release_tty prio:normal actionable serial 22 syz, C 2 1d03h 4d04h 0/29 upstream: reported C repro on 2026/08/11 02:03

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in release_tty+0x3b8/0x830 drivers/tty/tty_io.c:1592
Write of size 8 at addr ffff88811f0ae0b0 by task syz.2.75/658

CPU: 0 PID: 658 Comm: syz.2.75 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 __dump_stack+0x21/0x24 lib/dump_stack.c:88
 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
 print_address_description+0x71/0x200 mm/kasan/report.c:316
 print_report+0x4a/0x60 mm/kasan/report.c:420
 kasan_report+0x122/0x150 mm/kasan/report.c:524
 __asan_report_store8_noabort+0x17/0x20 mm/kasan/report_generic.c:356
 release_tty+0x3b8/0x830 drivers/tty/tty_io.c:1592
 tty_release_struct+0xbf/0xe0 drivers/tty/tty_io.c:1700
 tty_release+0xbb7/0x11d0 drivers/tty/tty_io.c:1860
 __fput+0x1fd/0x8f0 fs/file_table.c:320
 ____fput+0x15/0x20 fs/file_table.c:348
 task_work_run+0x1e1/0x250 kernel/task_work.c:203
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0x9b/0xb0 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0x87/0xd0 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
 syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:303
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fe5f879e0d9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdc93c4bd8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007fe5f8a27da0 RCX: 00007fe5f879e0d9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007fe5f8a27da0 R08: 0000000000000006 R09: 0000000000000000
R10: 00007fe5f8a27cb0 R11: 0000000000000246 R12: 0000000000008efc
R13: 00007fe5f8a25fac R14: 0000000000008c23 R15: 00007ffdc93c4ce0
 </TASK>

Allocated by task 659:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:380 [inline]
 __kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:389
 kasan_kmalloc include/linux/kasan.h:212 [inline]
 kmalloc_trace+0x40/0xb0 mm/slab_common.c:1033
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 gs_port_alloc drivers/usb/gadget/function/u_serial.c:1166 [inline]
 gserial_alloc_line_no_console+0x238/0x700 drivers/usb/gadget/function/u_serial.c:1246
 obex_alloc_inst+0x86/0xe0 drivers/usb/gadget/function/f_obex.c:435
 try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
 usb_get_function_instance+0xf3/0x310 drivers/usb/gadget/functions.c:44
 function_make+0x118/0x360 drivers/usb/gadget/configfs.c:652
 configfs_mkdir+0x518/0x9e0 fs/configfs/dir.c:1329
 vfs_mkdir+0x39c/0x580 fs/namei.c:4113
 do_mkdirat+0x174/0x4d0 fs/namei.c:4138
 __do_sys_mkdirat fs/namei.c:4153 [inline]
 __se_sys_mkdirat fs/namei.c:4151 [inline]
 __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4151
 x64_sys_call+0x73d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 659:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0x132/0x180 mm/kasan/common.c:242
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:250
 kasan_slab_free include/linux/kasan.h:178 [inline]
 slab_free_hook mm/slub.c:1750 [inline]
 slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1776
 slab_free mm/slub.c:3712 [inline]
 __kmem_cache_free+0xb7/0x1b0 mm/slub.c:3728
 kfree+0x6f/0xf0 mm/slab_common.c:990
 gserial_free_port+0x240/0x2d0 drivers/usb/gadget/function/u_serial.c:1210
 gserial_free_line+0x9b/0x1a0 drivers/usb/gadget/function/u_serial.c:1227
 obex_free_inst+0x39/0x60 drivers/usb/gadget/function/f_obex.c:421
 usb_put_function_instance+0x9b/0xc0 drivers/usb/gadget/functions.c:77
 obex_attr_release+0x15/0x20 drivers/usb/gadget/function/f_obex.c:391
 config_item_cleanup fs/configfs/item.c:128 [inline]
 config_item_release fs/configfs/item.c:137 [inline]
 kref_put include/linux/kref.h:65 [inline]
 config_item_put+0x166/0x210 fs/configfs/item.c:149
 configfs_rmdir+0x8c9/0x980 fs/configfs/dir.c:1540
 vfs_rmdir+0x381/0x4f0 fs/namei.c:4198
 do_rmdir+0x261/0x6b0 fs/namei.c:4259
 __do_sys_rmdir fs/namei.c:4278 [inline]
 __se_sys_rmdir fs/namei.c:4276 [inline]
 __x64_sys_rmdir+0x49/0x50 fs/namei.c:4276
 x64_sys_call+0x68e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:85
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff88811f0ae000
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 176 bytes inside of
 1024-byte region [ffff88811f0ae000, ffff88811f0ae400)

The buggy address belongs to the physical page:
page:ffffea00047c2a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11f0a8
head:ffffea00047c2a00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 ffffea000483cc00 dead000000000002 ffff888100043080
raw: 0000000000000000 0000000000100010 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 232, tgid 232 (sshd-session), ts 15527039232, free_ts 15522187508
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2672
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2679
 get_page_from_freelist+0x2ca9/0x2d20 mm/page_alloc.c:4586
 __alloc_pages+0x1fa/0x610 mm/page_alloc.c:5930
 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1
 allocate_slab mm/slub.c:1967 [inline]
 new_slab+0x98/0x3e0 mm/slub.c:2020
 ___slab_alloc+0x70f/0xb70 mm/slub.c:3177
 __slab_alloc+0x5e/0xa0 mm/slub.c:3263
 slab_alloc_node mm/slub.c:3348 [inline]
 __kmem_cache_alloc_node+0x204/0x2d0 mm/slub.c:3423
 __do_kmalloc_node mm/slab_common.c:937 [inline]
 __kmalloc_node_track_caller+0xa1/0x1e0 mm/slab_common.c:958
 kmalloc_reserve net/core/skbuff.c:449 [inline]
 __alloc_skb+0x226/0x4a0 net/core/skbuff.c:518
 alloc_skb_fclone include/linux/skbuff.h:1372 [inline]
 tcp_stream_alloc_skb+0x47/0x360 net/ipv4/tcp.c:871
 tcp_sendmsg_locked+0xcb7/0x39f0 net/ipv4/tcp.c:1334
 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1492
 inet_sendmsg+0xb6/0xd0 net/ipv4/af_inet.c:841
 sock_sendmsg_nosec net/socket.c:716 [inline]
 __sock_sendmsg net/socket.c:728 [inline]
 sock_write_iter+0x2ea/0x3f0 net/socket.c:1133
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1580 [inline]
 free_pcp_prepare mm/page_alloc.c:1654 [inline]
 free_unref_page_prepare+0x80c/0x820 mm/page_alloc.c:3621
 free_unref_page+0x93/0x530 mm/page_alloc.c:3719
 free_the_page mm/page_alloc.c:863 [inline]
 free_compound_page+0x99/0xd0 mm/page_alloc.c:886
 destroy_large_folio+0x68/0xa0 mm/page_alloc.c:923
 __folio_put_large mm/swap.c:113 [inline]
 __folio_put+0xd1/0xe0 mm/swap.c:121
 folio_put include/linux/mm.h:1442 [inline]
 put_page include/linux/mm.h:1494 [inline]
 page_to_skb+0x4e1/0xb50 drivers/net/virtio_net.c:565
 receive_mergeable drivers/net/virtio_net.c:1158 [inline]
 receive_buf+0x469/0x4890 drivers/net/virtio_net.c:1297
 virtnet_receive drivers/net/virtio_net.c:1592 [inline]
 virtnet_poll+0x5c9/0x1150 drivers/net/virtio_net.c:1710
 __napi_poll+0xcd/0x5d0 net/core/dev.c:6644
 napi_poll net/core/dev.c:6711 [inline]
 net_rx_action+0x4a3/0xa90 net/core/dev.c:6825
 handle_softirqs+0x1d7/0x600 kernel/softirq.c:642
 __do_softirq kernel/softirq.c:680 [inline]
 invoke_softirq kernel/softirq.c:497 [inline]
 __irq_exit_rcu+0x52/0xf0 kernel/softirq.c:729
 irq_exit_rcu+0x9/0x10 kernel/softirq.c:741
 common_interrupt+0xbe/0xe0 arch/x86/kernel/irq.c:242
 asm_common_interrupt+0x27/0x40 arch/x86/include/asm/idtentry.h:682

Memory state around the buggy address:
 ffff88811f0adf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88811f0ae000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88811f0ae080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff88811f0ae100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811f0ae180: 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
2026/08/10 10:23 android14-6.1 92668decd5e0 5d63f80b .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in release_tty
* Struck through repros no longer work on HEAD.