KASAN: use-after-free Read in check_tty_count

Status: upstream: reported C repro on 2026/08/10 10:56
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+eb4da01ac4602c751ae0@syzkaller.appspotmail.com
First crash: 12d, last: 12d
Bug presence (2)
Date Name Commit Repro Result
2026/08/21 lts (merge base) 228da13e907e C [report] KASAN: use-after-free Read in check_tty_count
2026/08/21 upstream (ToT) 818bebeb63dd C [report] KASAN: slab-use-after-free Read in check_tty_count
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 KASAN: use-after-free Read in check_tty_count 19 syz, C 1 9d22h 9d22h 0/2 upstream: reported C repro on 2026/08/13 03:54
android-5-10 KASAN: use-after-free Read in check_tty_count 19 syz, C 3 3d00h 12d 0/2 upstream: reported C repro on 2026/08/10 02:57
upstream KASAN: slab-use-after-free Read in check_tty_count serial prio:normal 19 syz, C error 2 8d21h 5d13h 0/29 upstream: reported C repro on 2026/08/17 13:05
android-6-12 KASAN: slab-use-after-free Read in check_tty_count origin:upstream 19 syz, C 4 1d13h 11d 0/1 premoderation: reported C repro on 2026/08/11 15:00

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:72 [inline]
BUG: KASAN: use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
BUG: KASAN: use-after-free in tty_port_kopened include/linux/tty_port.h:228 [inline]
BUG: KASAN: use-after-free in check_tty_count+0x1a8/0x330 drivers/tty/tty_io.c:287
Read of size 8 at addr ffff88811074f910 by task syz-executor301/311

CPU: 1 PID: 311 Comm: syz-executor301 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
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189
 __kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31
 instrument_atomic_read include/linux/instrumented.h:72 [inline]
 _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
 tty_port_kopened include/linux/tty_port.h:228 [inline]
 check_tty_count+0x1a8/0x330 drivers/tty/tty_io.c:287
 tty_release+0x88/0x11d0 drivers/tty/tty_io.c:1736
 __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
 exit_task_work include/linux/task_work.h:39 [inline]
 do_exit+0xaf2/0x2850 kernel/exit.c:887
 do_group_exit+0x21b/0x2e0 kernel/exit.c:1030
 __do_sys_exit_group kernel/exit.c:1041 [inline]
 __se_sys_exit_group kernel/exit.c:1039 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1039
 x64_sys_call+0x7b4/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232
 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
RIP: 0033:0x7fd2bd00c745
Code: Unable to access opcode bytes at 0x7fd2bd00c71b.
RSP: 002b:00007ffddb0c0e78 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fd2bd00c745
RDX: 00000000000000e7 RSI: ffffffffffffffd0 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 00007fd2bd0bd120 R14: 00007fd2bd0bf4e8 R15: 00007fd2bd0bf500
 </TASK>

Allocated by task 312:
 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 312:
 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 ffff88811074f800
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 272 bytes inside of
 1024-byte region [ffff88811074f800, ffff88811074fc00)

The buggy address belongs to the physical page:
page:ffffea000441d200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x110748
head:ffffea000441d200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 0000000000000000 dead000000000001 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 91, tgid 91 (klogd), ts 4455739900, free_ts 0
 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 include/linux/skbuff.h:1322 [inline]
 alloc_skb_with_frags+0xa8/0x620 net/core/skbuff.c:6176
 sock_alloc_send_pskb+0x87f/0x9a0 net/core/sock.c:2761
 unix_dgram_sendmsg+0x5c1/0x1710 net/unix/af_unix.c:1947
 sock_sendmsg_nosec net/socket.c:716 [inline]
 __sock_sendmsg net/socket.c:728 [inline]
 __sys_sendto+0x4ac/0x660 net/socket.c:2142
 __do_sys_sendto net/socket.c:2154 [inline]
 __se_sys_sendto net/socket.c:2150 [inline]
 __x64_sys_sendto+0xe5/0x100 net/socket.c:2150
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88811074f800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811074f880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88811074f900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff88811074f980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811074fa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
WARNING: CPU: 1 PID: 311 at drivers/usb/gadget/function/u_serial.c:694 gs_close+0x17d/0x9b0 drivers/usb/gadget/function/u_serial.c:694
Modules linked in:
CPU: 1 PID: 311 Comm: syz-executor301 Tainted: G    B              syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:gs_close+0x17d/0x9b0 drivers/usb/gadget/function/u_serial.c:694
Code: 74 23 fe 41 ff cc 42 0f b6 04 2b 84 c0 0f 85 cf 06 00 00 48 8b 44 24 20 44 89 20 48 8b 5c 24 38 e9 cb 02 00 00 e8 93 74 23 fe <0f> 0b 48 8b 5c 24 38 e9 ba 02 00 00 e8 82 74 23 fe 49 8d bf a8 02
RSP: 0018:ffffc90000ec79e0 EFLAGS: 00010093
RAX: ffffffff834df1ad RBX: 1ffff110220e9f1a RCX: ffff88810fcf0000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90000ec7b00 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffff520001d8f2c R12: 0000000000000000
R13: dffffc0000000000 R14: 1ffff920001d8f44 R15: ffff88811074f800
FS:  0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd2bd08973c CR3: 000000000700f000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 tty_release+0x32b/0x11d0 drivers/tty/tty_io.c:1753
 __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
 exit_task_work include/linux/task_work.h:39 [inline]
 do_exit+0xaf2/0x2850 kernel/exit.c:887
 do_group_exit+0x21b/0x2e0 kernel/exit.c:1030
 __do_sys_exit_group kernel/exit.c:1041 [inline]
 __se_sys_exit_group kernel/exit.c:1039 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1039
 x64_sys_call+0x7b4/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232
 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
RIP: 0033:0x7fd2bd00c745
Code: Unable to access opcode bytes at 0x7fd2bd00c71b.
RSP: 002b:00007ffddb0c0e78 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fd2bd00c745
RDX: 00000000000000e7 RSI: ffffffffffffffd0 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 00007fd2bd0bd120 R14: 00007fd2bd0bf4e8 R15: 00007fd2bd0bf500
 </TASK>
---[ end trace 0000000000000000 ]---

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/10 11:54 android14-6.1 92668decd5e0 5d63f80b .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in check_tty_count
2026/08/10 11:25 android14-6.1 92668decd5e0 5d63f80b .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in check_tty_count
2026/08/10 10:54 android14-6.1 92668decd5e0 5d63f80b .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in check_tty_count
* Struck through repros no longer work on HEAD.